News for hackers. Stuff that matters.
Re:Intel i7 loop performance anomaly by thelucky41 on Tuesday December 03, 2013 @02:21PM (#6842441)
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.
Re:Intel i7 loop performance anomaly by mjn on Tuesday December 03, 2013 @04:24PM (#6843292)
Google's microoptimizer actually has "try inserting random NOOPs" as one of its optimization passes: http://code.google.com/p/mao/
Re:Intel i7 loop performance anomaly by mason55 on Tuesday December 03, 2013 @02:23PM (#6842466)
He mentioned in the comments that he ensured everything is aligned to 64-bit boundaries
Re:Intel i7 loop performance anomaly by fleitz on Tuesday December 03, 2013 @03:01PM (#6842764)
64 bit might not be the right alignment, and even aligned to 64 bit boundaries you can run into page and cacheline issues.
Re:Intel i7 loop performance anomaly by malkia on Tuesday December 03, 2013 @03:15PM (#6842862)
Don't you always have to pad back with nops (0x90) since the scheduler might be looking ahead for other instructions to execute (or maybe not, since it's seeing jmp back). Just wildly guessing here...
Re:Intel i7 loop performance anomaly by eliben on Tuesday December 03, 2013 @03:49PM (#6843086)
Just to be clear, I tried it with 64-byte alignment