Wc2: Investigates optimizing ‘wc’, the Unix word count program

The wc2 project introduces a new algorithm, asynchronous state-machine parsing, to improve the efficiency and scalability of a word count program compared to traditional methods. This approach allows for faster processing, even in slow languages like JavaScript. The project includes versions in C and JavaScript, showcasing the unique state-machine parser. Implementing a full UTF-8 version challenges the traditional ASCII simplification and demonstrates equal speed across different character sets. Benchmark tests reveal consistent speeds for the state machine approach, outperforming built-in programs and showing promise for network scalability. The project also includes additional tools and explores the use of pointer arithmetic in C for potential speed enhancements.

https://github.com/robertdavidgraham/wc2

To top