Using vectorization to speed up UTF-8 character counting
daemonology.net
daemonology.net
A similar article which originally taught me these tenants is:
If you have a modern CPU, that code operates on 8 bytes at a time. :-)
Something is wrong with the testing, I think.