Get the latest tech news

Fast UDP I/O for Firefox in Rust


Motivation Around 20% of Firefox’s HTTP traffic today uses HTTP/3, which runs over QUIC, which in turn runs over UDP. This translates to substantial UDP I/O activity. Firefox uses NSPR for most of its network I/O. When it comes to UDP I/O, NSPR only offers a limited set of dated APIs, most relevant here PR_SendTo and PR_RecvFrom, wrappers around POSIX’s sendto and recvfrom. The N in NSPR stands for Netscape, giving you a hint of its age.

Next, either the kernel, but really ideally the network interface card, will segment it into multiple smaller packets, add a header to each and calculates the UDP checksum. After many hours of back and forth with the reporter, luckily a Mozilla employee as well, I ended up buying the exact same laptop, same color, in a desperate attempt to reproduce the issue. Without much luck at first, I eventually needed a Linux command line tool, thus installed WSL, and to my surprise, that triggered the bug ( reproducer).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Firefox

Firefox

Photo of Rust

Rust

Photo of fast udp

fast udp

Related news:

News photo

Wild: A Very Fast Linker Written In Rust, Aims To Outperform Mold Linker

News photo

Engineering a fixed-width bit-packed integer vector in Rust

News photo

SedonaDB: A new geospatial DataFrame library written in Rust