logoalt Hacker News

mlmonkey • yesterday at 12:35 AM • 3 replies • view on HN

> The end result is a memory-safe video decoder that runs 2.7x faster than the Rust port, with identical video output, bringing it closer to the optimized C++.

So ... Rust still can't beat the C++ implementation :-D

Sorry, didn't mean to ignite a langwar, but it's still interesting to see.


Replies

pasteleft • yesterday at 2:31 AM

"Safe Rust" being closer to "optimized C++". And those "optimized C++" usually incldues assembly code, so it's a huge improvement.

Of course, Rust is not a magic, so just porting to Rust wouldn't make this performance improvement. It seems their AI overfitted code to Rust compiler to find safe Rust code that compiles to efficient assembly.

himata4113 • yesterday at 2:49 AM

Additional safety checks do mean less performance, it's the same thing as hardened allocators. Rust will panic if for some reason you attempt to read outside the bounds of a slice object (even when it should be impossible to be outside those bounds)

manbash • yesterday at 3:58 AM

If it's "rust still can't beat... performance-wise", then yeah I guess.

But there are other criteria. The move to rust might've also resolved numerous potential memory-safety bugs in the decoder.

➕ show 1 reply