38 ms·
No I don't mean. It is possible to write idiomatic Rust and C. It is possible to write assembly in the form of Rust and C. In both cases, they're comparable in
by nindalf 2y ago
No I don't mean.
It is possible to write idiomatic Rust and C. It is possible to write assembly in the form of Rust and C. In both cases, they're comparable in performance.
But leaving toy programs like Benchmarks Game and AoC aside, I gave 6 examples of Rust outperforming C. Do you have any examples of C outperforming Rust?
- igouy 2y ago> Do you have any examples of C outperforming Rust? I don't have a pony in that race. > uutils/sort outperforms coreutils/sort by 6x "He used the hyperfine command-line benchmarking tool to run a test ten times; sorting a text file containing all of Shakespeare's works to see which implementation was faster. The first time he performed the test, he used a debug build of the Rust version of sort. In that demo, Rust's version was 1.45x faster than the GNU version. Then he ran the test again using a non-debug version, which showed the Rust version performing the test six times faster than GNU's implementation." Might it be that a new implementation in C would also have been faster?
- nindalf 2y agoMight not. The Rust standard library has a state of the art sort implementation. There’s nothing faster, in any language - https://github.com/rust-lang/rust/pull/124032 https://github.com/rust-lang/rust/pull/124032. And sure, it’s possible that someone could write a C program that compares in speed to all the Rust programs I’ve mentioned. C is a Turing complete language after all. I’m only pointing out that it hasn’t happened in practice. Also check the Android Binder code before (C https://github.com/torvalds/linux/blob/master/drivers/android/binder.c https://github.com/torvalds/linux/blob/master/drivers/androi...) and after (Rust - https://android.googlesource.com/platform/frameworks/native/+/master/libs/binder/rust/src/binder.rs https://android.googlesource.com/platform/frameworks/native/...). Same speed but the quality difference, it’s incomparable.
- igouy 2y ago> And sure, it’s possible … Because anecdote. We can only know when the thing is designed as an experiment. (All credit to who-so-ever is working to write improved versions.)
- nindalf 2y ago> Because anecdote I don’t think anyone could have said something more rude or ignorant if they tried. > designed as an experiment Ha. As if you could design such an experiment. What, you’ll place two rats at a keyboard and ask them to implement grep? Bffr. I’m pointing out the obvious - no one has actually written these mythical C programs that outperform Rust, to say nothing about security and reliability. You’ve deluded yourself into thinking that all it needs is “an experiment”. lol.
- igouy 2y agoThe quoted text seems dictionary definition anecdote.