A deep dive into BPF LPM trie performance and optimization
Oct 21, 2025Matt Fleming, Jesper Brouer

Summary
This post dives deep into the performance of BPF LPM tries, a critical data structure used for IP and IP+Port matching in network packet routing and firewall rules. It explains the mechanics of tries, highlights the shortcomings of the current BPF LPM trie implementation (limited branching, lack of level compression), and presents benchmark data showing performance degradation with increasing entry counts. The post identifies specific bottlenecks like slow lookups, updates, deletes, and particularly map freeing, which can lead to production issues like soft lockups and packet loss, setting the stage for future optimization efforts.
More from the Hardware Infrastructure & Performance Optimization trail
- How we reduced core unit boot time from hours to minutes
- A one-line Kubernetes fix that saved 600 hours a year
- Inside Gen 13- how we built our most powerful server yet
- Launching Cloudflare’s Gen 13 servers- trading cache for cores for 2x edge compute performance
- So long, and thanks for all the fish- how to escape the Linux networking stack