3 ms·
I wonder if the simpler Boyer-Moore-Horspool might be even faster, since in practice BMH beats regular BM except in the pathological cases: http://old.blog.phu
by userbinator 10y ago
I wonder if the simpler Boyer-Moore-Horspool might be even faster, since in practice BMH beats regular BM except in the pathological cases:
http://old.blog.phusion.nl/2010/12/06/efficient-substring-searching/ 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/UFscifOU8AQ https://groups.google.com/d/topic/mechanical-sympathy/UFscif...
- ComputerGuru 10y agoNope, or at least, not necessarily. Have fun reading this: http://ridiculousfish.com/blog/posts/old-age-and-treachery.html http://ridiculousfish.com/blog/posts/old-age-and-treachery.h...
- jcranmer 10y ago2006 is a bit old when talking about newer Intel CPUs.
- goldenkey 10y agoProcessor competition in the desktop market has been lackluster since that time. Intel has been sitting on their laurels mostly. The vectored primitives and bigger cache and core counts are nice but honestly you have been fooled by the branding and continual product lines. Loop unrolling still helps even with brand spankin new CPUs. Some intent cannot be inferred.
- jcranmer 10y ago> Processor competition in the desktop market has been lackluster since that time. Intel has been sitting on their laurels mostly. The vectored primitives and bigger cache and core counts are nice but honestly you have been fooled by the branding and continual product lines. 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.