Rust developers offered $20k for rav1d to reach C performance

3 days ago 4

Rust programming mascot as the folks behind AV1 video decoder rav1d are looking for developers to get it running as fast as its C language cousin, dav1d.

Ryan Daws is a senior editor at TechForge Media with over a decade of experience in crafting compelling narratives and making complex topics accessible. His articles and interviews with industry leaders have earned him recognition as a key influencer by organisations like Onalytica. Under his leadership, publications have been praised by analyst firms such as Forrester for their excellence and performance. Connect with him on X (@gadget_ry), Bluesky (@gadgetry.bsky.social), and/or Mastodon (@[email protected])


The folks behind Rust-based AV1 video decoder rav1d are looking for developers to get it running as fast as its C-based cousin, dav1d.

It all kicked off back in March 2023. The plan? Build a high-performance AV1 decoder, but with all the memory safety goodness Rust brings. They teamed up with Immunant for the heavy lifting on the engineering side.

Fast forward to September 2024, and rav1d was pretty much there – “basically complete,” as they put it. It passes all the same tests as the dav1d decoder it’s based on, and you can even get Chromium to play nice with it. But, the one little niggle: “it’s not quite as fast as the C version.”

Now, we’re talking about a gap of roughly 5% slower than the C-based dav1d. It might not sound like a chasm, but as they say, it’s “enough of a difference to be a problem for potential adopters.” And, it clearly gets under their skin a bit: “frankly, it just bothers us.”

They haven’t been twiddling their thumbs, mind. The core rav1d team slogged away at optimisation, even bringing in some specialist contractors. They’ve even written about their optimisation journey. But that last little bit of performance parity has remained stubbornly out of reach.

“We were still unable to get to performance parity and, to be frank again, we aren’t really sure what to do next,” they admit with a refreshing honesty.

This whole Rust versus C speed thing is a bit of a hot topic. Rust can often go toe-to-toe with C on speed in many areas. However, those brilliant safety features Rust boasts – like bounds checking – can add just a smidgen of overhead, especially in something as demanding as video work.

The good news is that optimisations are constantly chipping away at this gap, suggesting that with enough smarts and effort, Rust could indeed match C. This whole bounty, then, feels like a bit of a gauntlet thrown down to the Rust community.

The folks behind C-based FFmpeg couldn’t resist a cheeky comment: “Rust is so good you can get paid $20k to make it as fast as C.”

The hope with the bounty pool of $20,000 is pretty clear: get some fresh eyes and clever minds onto the problem to nudge rav1d over the finish line. And it’s not just about rav1d; they’re keen that “ideally we and the Rust community will also learn something about how Rust performance stacks up against C.”

If you’re thinking of having a crack, here’s the gist of the official rules:

  • Who can play? Individuals or teams, as long as you’re a legal resident or citizen of the US, UK, EU, EEA, Switzerland, Canada, New Zealand, or Australia.
  • How do you prove it? The full rules lay out how to benchmark any performance gains.
  • Where’s the magic needed? You can work your wonders on speeding up rav1d itself, the Rust compiler, or even the Rust standard library.
  • The big no-no: Both dav1d and rav1d share the exact same low-level assembly code optimisations. You absolutely “cannot modify this assembly.” The improvements must come from the Rust code or the compiler. Also, no sneaking in code written in other languages; it’s Rust all the way for rav1d.
  • Making it official: Get your improvements merged into the project like any other open-source contribution, then drop them an email as per the rules.

When it’s all over – either because the goal’s hit or time’s up – they’ll “at our discretion, divide the bounty proportionally between the largest contributors to performance gains.”

Ultimately, they’re holding the purse strings and “reserve the right to award the money to the person(s) or team(s) that we deem to have helped us reach or exceed performance parity in the best possible way.” So, it’s not just about the biggest gain, but the best gain.

This is more than just a cash prize; it’s a clarion call to the Rust community. Can they step up and show that Rust can truly compete in these high-stakes, performance-critical arenas that C has owned for so long?

See also: Chainguard rebuilds Python libraries to slam the door on malware

Want to learn more about cybersecurity and the cloud from industry leaders? Check out Cyber Security & Cloud Expo taking place in Amsterdam, California, and London. The comprehensive event is co-located with other leading events including Digital Transformation Week, IoT Tech Expo, Blockchain Expo, and AI & Big Data Expo.

Explore other upcoming enterprise technology events and webinars powered by TechForge here.

Tags: , , , , , ,

Read Entire Article