Background: I\'m trying to create a pure D language implementation of functionality that\'s roughly equivalent to C\'s memchr but uses arrays and indices i
GNU libc definitely uses the assembly version of memchr() (on any common linux distro). This is why it is so unbelievable fast.
For example, if we count lines in 11Gb file (like "wc -l" does) it takes around 2.5 seconds with assembly version of memchr() from GNU libc. But if we replace memchr() assembly call with for example memchr() C implementation from FreeBSD - the speed will decrease to like 30 seconds.
This is equal to replacing memchr() with just a while loop which compares one char after another.