-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement / optimize the shootout benchmarks #18085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
see #17989 for spectral-norm You can add secondary benchmarks: meteor-contest, chameleos-redux, thread-ring, binarytrees-redux |
Thank you, done. |
You can tick spectral-norm :) |
@TeXitoi Done |
The comparison should be with either C or C++, depending on which has a faster implementation. The C solutions are also valid C++ solutions so even a comparison to C++ would take them into account. These are typically the most optimized ones, not the higher-level ones taking advantage of C++ language features. |
We probably all share a dislike for microbenchmarks, but i think we need to play this game since many people judge Rust by it. And since Rust is seen as a C++ alternative, they will probably look at how Rust compares to the C++ shootouts. If Rust turns out to be faster than any language/implementation, i'd be more than happy. |
@kud1ing: The C implementations are usable as C++ ones. Rust as seen as an alternative to C and C++, not just C++. If you want to ignore them then I'll happily resubmit the C implementations as slightly modified C++ implementations to move the bar to where it should be. |
I am not opposed to aim for what falls in the "gcc" category in the benchmarks game. |
@kud1ing you can add #18357 to reverse-complement and ticks it! http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=revcomp&lang=all&id=4&data=u64q Thanks to @mahkoh for this one :) |
Done, thanks. Awesome. |
Optimizing regex-dna is blocked on #16989. It's also the slowest by far of all our programs on the benchmarks game. This may seem spurious, but I'm nominating this for 1.0 (with the possible exception of regex-dna, if enhancements to |
@bstrie: There are other slow implementations: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=gcc The default baseline language will switch once it gets a bit faster, and then it looks bad again. |
(which is why Python, JavaScript, etc. get compared against Java) |
P-low. We show pretty well on their already. More effort is desired, but icing. |
Part of rust-lang#18085 Instead of using an Enum, we use a struct with Option<&Tree> as leaves. It allow to limit a lot of allocation. before: ``` texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees-orig 20 stretch tree of depth 21 check: -1 2097152 trees of depth 4 check: -2097152 524288 trees of depth 6 check: -524288 131072 trees of depth 8 check: -131072 32768 trees of depth 10 check: -32768 8192 trees of depth 12 check: -8192 2048 trees of depth 14 check: -2048 512 trees of depth 16 check: -512 128 trees of depth 18 check: -128 32 trees of depth 20 check: -32 long lived tree of depth 20 check: -1 real 0m3.860s user 0m11.032s sys 0m3.572s ``` after: ``` texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees 20 stretch tree of depth 21 check: -1 2097152 trees of depth 4 check: -2097152 524288 trees of depth 6 check: -524288 131072 trees of depth 8 check: -131072 32768 trees of depth 10 check: -32768 8192 trees of depth 12 check: -8192 2048 trees of depth 14 check: -2048 512 trees of depth 16 check: -512 128 trees of depth 18 check: -128 32 trees of depth 20 check: -32 long lived tree of depth 20 check: -1 real 0m2.824s user 0m9.224s sys 0m1.428s ```
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized. This issue has been moved to the RFCs repo: rust-lang/rfcs#665 |
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢 With this change and rust-lang#18085 together, all remaining errors are type errors. This may mean we can enable more errors, but this is out of scope for this PR.
fix: Correctly escape strings in our quote macro This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢 (because this worked incorrectly with `stringify!()`, which means every `quote!()` (the original one) quoting a string also didn't work). With this change and rust-lang#18085 together, all remaining errors are type errors. This may mean we can enable more errors, but this is out of scope for this PR.
feat: Provide an config option to not set `cfg(test)` Fixes rust-lang#17957.
This is supposed to be a meta issue for optimization efforts like http://www.reddit.com/r/rust/comments/2j2ij3/benchmark_improvement_reverse_compliment/
The benchmarks to optimize (where rustc is slower than g++, according to http://benchmarksgame.alioth.debian.org/u64q/rust.php):
Secondary benchmarks:
The text was updated successfully, but these errors were encountered: