-Cllvm-args=-enable-dfa-jump-thread option, which recovers most of the performance here. It performs a kind of jump threading for deterministic finite automata, and our decompression logic matches this pattern.
I suspect the results won't be quite as good on Aarch64 or other architectures though. zlib-ng has a pretty wide range of hand-optimized intrinsics whereas zlib-rs seems to only really have x86_64.
The one area where C will always beat Rust (at least today) will probably always be portability, C compilers run everywhere, on everything, and to anything... Unless Rust has similar capabilities via LLVM?
Many of those vendors are slowly throwing away these proprietary toolchains, some of them are actually GCC forks, never ever updated, and replacing them with clang.
So it depends, on how much those vendors will care to support Rust for their customers, or if those kind of customers even care about anything else than their beloved C dialect.
I think the only place C really beats Rust is in vendors with toolchains they’ve stopped investing in. More broadly there’s clearly pressure for the industry to abandon C/C++ in favor of Rust given the inability of the language to be modernized into a safe version.
[1] https://doc.rust-lang.org/nightly/rustc/platform-support.htm...