4 ms·
modern processors are really, really fast at simple, straight-line operations Also really tiny loops; what slows them down is having to make lots of conditiona
by userbinator 13y ago
modern processors are really, really fast at simple, straight-line operations
Also really tiny loops; what slows them down is having to make lots of conditional branches/calls.
This related article could be interesting for those who are curious to know how fast plain C (not even inline Asm) can do string searches: http://www.codeproject.com/Articles/250566/Fastest-strstr-like-function-in-C http://www.codeproject.com/Articles/250566/Fastest-strstr-li...
I do wish Intel/AMD would make the REP SCASB/CMPSB instructions faster, since they could enable even faster and efficient string searches limited only by memory bandwidth. (Or they could add a new instruction for memmem-like functionality, although I'd prefer the former.)