5 ms·
Familiarize yourself with the tools for measuring performance on whatever platform you want to optimize for. Then you can just start messing around and seeing
by panic 4y ago
Familiarize yourself with the tools for measuring performance on whatever platform you want to optimize for. Then you can just start messing around and seeing what kinds of things make the number go down.
- nomel 4y ago> Then you can just start messing around and seeing what kinds of things make the number go down. And this will almost certainly require a deep understanding of the instruction set, and dropping into inline ASM, periodically.
- panic 4y agoOptimizing memory layout and reducing allocations are pretty ISA-independent. But yeah, at some point you will have to start looking at the assembly to optimize further (even if only to know when to tell the compiler to stop inlining a function that causes tons of register spilling inside a tight loop).
- saagarjha 4y agoIn most cases there’s a lot you can do by just peeking at the source code. Almost all programs ship without having been run through a profiler at all.