Re: code optimization in embedded systems
- From: Patrick de Zeester <invalid@xxxxxxxxxxxxxxx>
- Date: Sat, 17 Nov 2007 22:34:40 +0100
Stefan Reuther wrote:
Wilco Dijkstra wrote:"Ken Asbury" <avoidingspam2001@xxxxxxxxx> wrote in messageNot to sound argumentative, but my experience (and a very good livingI don't mind sounding argumentative, but 10 times is just ridiculous,
over the last 30+ years) has repeatedly demonstrated that, in an
embedded environment, someone familiar with both disciplines can
routinely achieve an order of magnitude improvements in speed of
selected functions. The trick is to be able to determine which
functions
to rewrite in assembler.
it is simply impossible for a compiler to produce code that bad.
Look at gcc56k and write a simple FIR filter. Then do the same in 56k
assembler and compare. Our 56k developer once showed me the listings,
and there easily is a 10x difference.
In case of the good old 56000 DSP I can imagine that to be true. I remember a 56000 developer I used to work with which was particulary good in translating algorithms to handcrafted 56000 code. In this case the inner loop took in C about 10 statements, the 56000 code was 2 or 3 instructions. It took him more than a day and several iterations to get there, and the code had no resemblance what so ever with the original C code.
Granted, gcc56k is really old, but when I evaluated Blackfin gcc a while
ago, I also saw a magnitude difference to VisualDSP++ for similar
computationally intensive code. gcc simply isn't yet smart enough for
that target (maybe it is today, haven't looked for a while).
GCC isn't generally know for its optimizer, often there are better alternatives.
Modern compilers routinely beat all but the most experienced assembly
programmers. On ARM for example you'd be having difficulty getting
more than 10% speedup over compiled code, and getting more than
that is only possible in extremely rare cases. However even 2 times
speedup for a non-trivial piece of code is impossible.
Billions of ARM processors are shipped each year, hence good tools for
them are widely available and understood. For lower volume
architectures, it might look much worse.
It also depends on the architecture itself, some architectures are just no good targets for C compilers.
.
- Follow-Ups:
- Re: code optimization in embedded systems
- From: Jyrki Saarinen
- Re: code optimization in embedded systems
- References:
- code optimization in embedded systems
- From: yusibin
- Re: code optimization in embedded systems
- From: Kirk Zurell
- Re: code optimization in embedded systems
- From: Ken Asbury
- Re: code optimization in embedded systems
- From: Wilco Dijkstra
- Re: code optimization in embedded systems
- From: Stefan Reuther
- code optimization in embedded systems
- Prev by Date: Re: code optimization in embedded systems
- Next by Date: Re: TMS320C6727B
- Previous by thread: Re: code optimization in embedded systems
- Next by thread: Re: code optimization in embedded systems
- Index(es):
Relevant Pages
|