Re:How I Got a 2x Speedup With One Line of Code
by deweerdt on Thursday November 14, 2013 @11:12PM
(#6737694)
> I don't think this gain came from pre-fetching anything.
It may, and its possible that it doesn't show up on some cpus. see this thread for an example of how difficult it is to find a good generic prefetching size: https://lkml.org/lkml/2013/10/11/534
Re:How I Got a 2x Speedup With One Line of Code
by CountHackulus on Friday November 15, 2013 @12:14AM
(#6737869)
The lack of generated assembly shown makes this explanation just as likely.
I compiled (x86, GCC 4.8) lazysort.c both with and without the prefetch intrinsic, and there were substantial differences in code surrounding calls in to Python, but no change at all to the guts of the partition or sorting routines.
Regardless of what is responsible, it's not good to leave something like this in your code without really understanding what it did. There may have something else that occurred incidentally from this change, that could have lead you to a better solution.