Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Faster version of reference decoder #1
Hi, I read your http://nullprogram.com/blog/2017/10/06/ - interesting work. For what it's worth, note that at the end of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/#variations there is an improved version of the decoder that saves a shift for every byte, compared to the original version at the beginning of the article. Might be interesting to use the improved version as reference instead.
added a commit
Oct 8, 2017
You're right, the improved version is much faster! In the same setup (with the same benchmark that clearly favors the branchless version) it's 10% slower with GCC than the branchless version (improved from 20% slower). However, with Clang it's 20% _faster_ than the branchless version. I'll update my article to mention this. Thanks for getting in touch!