Improving PicoHTTPParser further with AVX2
Dec 18, 2014Vlad Krasnov

Summary
This post details the optimization of the PicoHTTPParser library using AVX2 instructions. The author explores the limitations of SSE4.2's PCMPESTRI instruction and demonstrates how AVX2, operating on 32-byte registers with higher throughput, can be leveraged. The optimization involves changing the logical flow from latency-bound to throughput-oriented by creating bitmaps of all token occurrences within a 128-byte window and using TZCNT to find the first qualifying byte. This resulted in a 1.68x-1.79x performance improvement.