Optimizations for embedded systems

Jan 04, 2007 3 Replies

Hi,



I'm reading a research paper that describes a loop optimization technique that removes nested conditional blocks. The authors claim that their transformation yields a speed-up of 30% on average applied to some embedded systems software (referring just to the code segments containing the nested loops). Since their approach duplicates the loop iteration space, they also provide the resulting code increase that is almost 80% on average.



What do you think, is this approach promising? I mean an execution speed-up of 30% for the nested loops is a great improvement, but on the other hand you almost double the loop code size. So, in my opinion, such a large code size increase for embedded systems with limited memory is very crucial and I wonder if embedded systems vendors would accept it or would rather completely forgo this optimization.



Thank you for your opinion.



Best regards, Christian


There is almost always a tradeoff between code size and speed. Every application is different so there is no 'right' answer, only ' most appropriate for this particular instance'. For the same reason, the figures above are also of course meaningless as every application will be different - in each case the optimum tradeoff needs to be considered. As code space is generally more important, the default behavour should be 'only unroll loops when and where is absolutely necessary'.

In article , Christian Christmann writes

As far as I know most embedded compilers already incorporate loop optimisation for speed or size. I don't think there is anything new here.

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Write for clarity, then profile the result. Do it under various optimization flags. Then apply that thing held up by your neck.

Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required