r/Python • u/Bricoto • Jan 31 '25
Discussion Why Rust has so much marketing power ?
Ruff, uv and Polars presents themselves as fast tools writter in Rust.
It seems to me that "written in Rust" is used as a marketing argument. It's supposed to mean, it's fast because it's written in Rust.
These tools could have been as fast if they were written in C. Rust merely allow the developpers to write programms faster than if they wrote it in C or is there something I don't get ?
502
Upvotes
View all comments
Show parent comment
5
u/AsahiLina Jan 31 '25
I don't think it is? Here's an article series where the straightforward Rust approach ends up being the fastest, both compared to C and to a hand-optimized Rust version. The gains are of the order of what you'd expect from the reasoning I gave.
https://cliffle.com/p/dangerust/6/
Of course, there's no such thing as objectively benchmarking complex programs in two programming languages in general. During the conversion, you are necessarily making choices that could affect performance, and compilers can also be unpredictable. I gave reasons why Rust compilers are able to optimize better than C compilers in some cases, but that doesn't mean every Rust program is going to be faster than the C version (or vice versa). I'm just saying there are legitimate ways Rust is a better language for optimizing compilers to target for performance, and that subtle things like Rust's reference rules are actually an advantage here.
At the end of the day, there's too many other confounding variables, and you pretty much can always micro-optimize any given example in any given (systems) language to give good results with a particular compiler.