News for hackers. Stuff that matters.
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.
Re:Why is one loop slower than 2 in C? by ahelwer on Sunday December 18, 2011 @01:09PM (#3367092)
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.
Re:Why is one loop slower than 2 in C? by dpe82 on Sunday December 18, 2011 @08:23PM (#3368066)
It's not always nothing, particularly when you're dealing with video. :)