Optimizing a Rust AV1 Decoder: Avoiding Unnecessary Zeroing and Optimizing Struct Comparisons
2025-05-22

By comparing the performance of the Rust-based AV1 decoder rav1d and the C-based dav1d, the author, using a sampling profiler, identified two performance bottlenecks. The first was unnecessary zeroing of a buffer in rav1d on ARM architecture, leading to performance degradation. The second was an inefficient implementation of struct comparisons in rav1d. By using `MaybeUninit` to avoid unnecessary zeroing and optimizing struct comparisons, the author improved rav1d's performance by almost 2%.
Development
AV1 Decoder