Re:Why is one loop slower than 2 in C?
by kia on Sunday December 18, 2011 @11:54AM
(#3366934)
In scientific computing it's not unusual to get 2x-3x speedups by doing simple optimizations like this one. For desktop applications it's nothing, but when your simulation is taking a week to complete then 2x-speedup is a huge improvement.
[ Parent
| on HN ]
This was especially the case on the old Pentium 4's. What we used to do was over-allocate the amount of memory needed, then offset the pointer into the allocated memory to avoid cache collisions.