by userbinator · 10y ago · 0 comments
http://old.blog.phusion.nl/2010/12/06/efficient-substring-se...
Also, unrolling loops may actually slow things down in modern x86 CPUs since they will automatically decode and cache very small loops. Some interesting discussion on that here:
https://groups.google.com/d/topic/mechanical-sympathy/UFscif...
Loop unrolling still helps even with brand spankin new CPUs. Some intent cannot be inferred.
I might be inclined to agree with you... if I didn't know that Haswell:
* implemented the computed goto transformation (for interpreter loops) in hardware
* made unaligned cache hits crossing cache line boundaries have no latency penalty
Both of those things are things that I would have told you were impossible(/infeasible) to do in hardware before finding out that Intel did them.
There's actually quite a lot of amazing microarchitectural changes going on in Intel processors, you just don't hear a lot about them.