Counting Words at SIMD Speed
I've written some progressively faster word counting programs. First, we'll start with Python, and then we'll drop down to C, and finally, we'll use single instruction, multiple data (SIMD) programming to go as fast as possible.The task is to count the words in an ASCII text file. For example, Hello there! contains 2 words, and my 1 GiB benchmark text file contains 65 million words.At a high level: read bytes, scan while tracking minimal state, write the count to stdout.These are the results fro...
Read more at healeycodes.com