16 ms·
I've run into something similiar on a different benchmark where inserting some 'nops' to the preamble for a function actually sped it up as much as 14% because
by thelucky41 13y ago
I've run into something similiar on a different benchmark where inserting some 'nops' to the preamble for a function actually sped it up as much as 14% because it made the function align better with a memory boundary so the CPU could access it faster. Benchmarks, especially ones that don't control for the cases where 'luck'/alignment/register use/etc can influence the outcome, are terrible testcases to explore behaviour.
- mason55 13y agoHe mentioned in the comments that he ensured everything is aligned to 64-bit boundaries
- fleitz 13y ago64 bit might not be the right alignment, and even aligned to 64 bit boundaries you can run into page and cacheline issues.
- mjn 13y agoGoogle's microoptimizer actually has "try inserting random NOOPs" as one of its optimization passes: http://code.google.com/p/mao/ http://code.google.com/p/mao/