Performance optimization strategies of last resort?

Posted by jerryjvl on Stack Overflow See other posts from Stack Overflow or by jerryjvl
Published on 2009-05-29T14:26:59Z Indexed on 2010/03/22 3:31 UTC
Read the original article Hit count: 318

There are plenty of performance questions on this site already, but it occurs to me that almost all are very problem-specific and fairly narrow. And almost all repeat the advice to avoid premature optimization.

Let's assume:

  • the code already is working correctly
  • the algorithms chosen are already optimal for the circumstances of the problem
  • the code has been measured, and the offending routines have been isolated
  • all attempts to optimize will also be measured to ensure they do not make matters worse

What I am looking for here is strategies and tricks to squeeze out up to the last few percent in a critical algorithm when there is nothing else left to do but whatever it takes.

Ideally, try to make answers language agnostic, and indicate any down-sides to the suggested strategies where applicable.

I'll add a reply with my own initial suggestions, and look forward to whatever else the SO community can think of.

© Stack Overflow or respective owner

Related posts about Performance

Related posts about optimization