Cloudflare, a leading internet performance and security company, has announced significant performance gains after completing a year-long migration of key network components to the Rust programming language. The company reports a 10ms reduction in median response latency and a 25% boost in CDN performance tests. These improvements come as part of a broader initiative to rebuild critical systems, which also resulted in enhanced security, faster development cycles, and more reliable operations.
At the heart of the upgrade is the replacement of their 15-year-old system, FL, with a new version, FL2, built entirely in Rust. This transition involved reengineering major components of their infrastructure and implementing a modular architecture that leverages Rust’s safety guarantees and performance characteristics. The migration included a staged rollout where teams could gradually transition their existing logic from LuaJIT-based implementations to Rust, significantly reducing the need for parallel development.
Cloudflare’s decision to adopt Rust was driven by its ability to eliminate common bugs such as memory safety issues and data races, which were prevalent in their previous system. By using Rust, the company has achieved substantial efficiency gains, with internal metrics showing that FL2 uses less than half the CPU and memory of its predecessor, FL1. These performance improvements not only enhance user experience but also enable the company to allocate more computational resources to feature development and innovation.
The performance gains have been measured using internal tools and independent benchmarks like CDNPerf, which confirmed the 10ms reduction in median response time. Cloudflare also highlights the security benefits of their new system, noting that Rust’s strong compile-time memory checks and type system help prevent a wide range of errors. As the company continues to phase out FL1 in favor of FL2, they anticipate further improvements in both performance and software reliability, with the full migration expected to be completed by early 2026.