Cloudflare

Building fast interpreters in Rust

Mar 4, 2019Ingvar Stepanyan, Andrew Galloni
Building fast interpreters in Rust
SummaryAI, from the source post

This post details the design of the wirefilter Rust library for parsing and executing Wireshark-like filters. It explains the choice of manual parsing over parser generators due to syntax ambiguities requiring contextual parsing. The execution engine was optimized by replacing HashMap lookups for field access with fixed-size arrays indexed by an IndexMap, leading to a ~2x speedup.

More from the Website Security & Threat Management trail