I'd add an addendum - look for stuff you don't need to do (e.g. at a low-level can you avoid that memcpy, zeroing things or multiple allocations when one would do, but even better at a high-level if you can avoid doing the whole thing altogether). It's better to just not do it rather than spends time trying to optimize it.