Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
1–10 of 19 posts
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#2The 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?
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#3Really interesting, I've never used the Rust version, I can only assume I've used the C implementation indirectly dozens of times if not hundreds, but does anyone know how 1:1 the Rust implementation is? 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.
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#4Really interesting, I've never used the Rust version, I can only assume I've used the C implementation indirectly dozens of times if not hundreds, but does anyone know how 1:1 the Rust implementation is? 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?
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#5Really interesting, I've never used the Rust version, I can only assume I've used the C implementation indirectly dozens of times if not hundreds, but does anyone know how 1:1 the Rust implementation is? 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?
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...
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#6Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#7Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#8Fascinating--I wonder to what extent the performance improvements are due to the better constraints Rust hands over to LLVM for optimization (specifically thinking `noalias` rules) vs aggressiv code optimization by the developers to be to the point where they beat the C zlib. The latter could be more difficult to achieve given how long the original zlib has been getting incrementally improved, though.
-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.
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#9Fascinating--I wonder to what extent the performance improvements are due to the better constraints Rust hands over to LLVM for optimization (specifically thinking `noalias` rules) vs aggressiv code optimization by the developers to be to the point where they beat the C zlib. The latter could be more difficult to achieve given how long the original zlib has been getting incrementally improved, though.
Re: Zlib-Rs Is Not Only Safer but Now Outperforming Zlib C Implementations
#10Are they exporting their library with the C-ABI? It's cool if it's fast and would be nice if I could link to it from non-Rust code.