Fast UDP I/O for Firefox in Rust
6 hours ago
- #QUIC
- #UDP
- #Firefox
- Firefox's HTTP/3 traffic uses QUIC over UDP, accounting for 20% of its HTTP traffic.
- NSPR, Firefox's network I/O library, uses outdated UDP APIs like PR_SendTo and PR_RecvFrom.
- Modern OS features like sendmmsg, recvmmsg, GSO, and GRO offer performance improvements for UDP I/O.
- Firefox's QUIC UDP I/O stack was rewritten in Rust for performance and security, leveraging quinn-udp.
- Performance improvements include throughput increases from <1Gbit/s to 4Gbit/s in CPU-bound scenarios.
- Platform-specific challenges were encountered, such as issues with Windows' USO/URO and Android's socketcall.
- Linux benefits the most with mature support for GSO/GRO, while macOS lacks segmentation offloading.
- ECN support was improved, with 50% of QUIC connections in Firefox Nightly using ECN-capable paths.
- Future work includes resolving Windows USO/URO issues and continuing OS/driver improvements for QUIC.