Building even faster interpreters in Rust
Sep 24, 2020Zak Cutner

Summary
This post details performance optimizations made to the Wirefilter engine, which powers Cloudflare's Firewall Rules and other security products. Key contributions include: development of a performance measurement framework using hardware counters and the perf_event_open API; techniques to speed up benchmarking by deduplication, sampling, and partitioning of filters; and optimization of the `contains` operator by leveraging specialized string searching algorithms and exploring the use of Rust's regex library for fixed-string patterns. The post also discusses the trade-offs involved in these optimizations and the importance of measuring performance in a distributed environment.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack