title: Performance optimization strategies of last resort
body: <p>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.</p>
  
  <p>Let's assume:</p>
  
  <ul>
  <li>the code already is working correctly</li>
  <li>the algorithms chosen are already optimal for the circumstances of the problem</li>
  <li>the code has been measured, and the offending routines have been isolated</li>
  <li>all attempts to optimize will also be measured to ensure they do not make matters worse</li>
  </ul>
  
  <p>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.</p>
  
  <p>Ideally, try to make answers language agnostic, and indicate any down-sides to the suggested strategies where applicable.</p>
  
  <p>I'll add a reply with my own initial suggestions, and look forward to whatever else the Stack Overflow community can think of.</p>