Skip to content
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

Implement / optimize the shootout benchmarks #18085

Closed
6 of 15 tasks
kud1ing opened this issue Oct 16, 2014 · 16 comments
Closed
6 of 15 tasks

Implement / optimize the shootout benchmarks #18085

kud1ing opened this issue Oct 16, 2014 · 16 comments
Labels
P-low Low priority

Comments

@kud1ing
Copy link

kud1ing commented Oct 16, 2014

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:

  • meteor-contest
  • chameleos-redux
  • thread-ring
  • binarytrees-redux
@kud1ing
Copy link
Author

kud1ing commented Oct 16, 2014

cc @brson @TeXitoi

@TeXitoi
Copy link
Contributor

TeXitoi commented Oct 16, 2014

see #17989 for spectral-norm

You can add secondary benchmarks: meteor-contest, chameleos-redux, thread-ring, binarytrees-redux

@kud1ing
Copy link
Author

kud1ing commented Oct 16, 2014

Thank you, done.

@thestinger thestinger changed the title Optimize the shootout benchmarks implement / optimize the shootout benchmarks Oct 16, 2014
@TeXitoi
Copy link
Contributor

TeXitoi commented Oct 18, 2014

You can tick spectral-norm :)

@kud1ing
Copy link
Author

kud1ing commented Oct 19, 2014

@TeXitoi Done

@thestinger
Copy link
Contributor

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.

@kud1ing
Copy link
Author

kud1ing commented Oct 22, 2014

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 kud1ing changed the title implement / optimize the shootout benchmarks Implement / optimize the shootout benchmarks Oct 22, 2014
@thestinger
Copy link
Contributor

@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.

@kud1ing
Copy link
Author

kud1ing commented Oct 24, 2014

I am not opposed to aim for what falls in the "gcc" category in the benchmarks game.
Aiming for "g++" first, has a smaller scope and thus is more attractive - and even that will take weeks to achieve.

@TeXitoi
Copy link
Contributor

TeXitoi commented Oct 30, 2014

@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 :)

@kud1ing
Copy link
Author

kud1ing commented Oct 30, 2014

Done, thanks. Awesome.

@bstrie
Copy link
Contributor

bstrie commented Dec 11, 2014

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 regex! would take too long). Marketing matters!

@thestinger
Copy link
Contributor

@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.

@thestinger
Copy link
Contributor

(which is why Python, JavaScript, etc. get compared against Java)

@brson brson added P-low Low priority and removed I-nominated labels Dec 11, 2014
@brson
Copy link
Contributor

brson commented Dec 11, 2014

P-low. We show pretty well on their already. More effort is desired, but icing.

TeXitoi added a commit to TeXitoi/rust that referenced this issue Jan 10, 2015
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
```
@steveklabnik
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-low Low priority
Projects
None yet
Development

No branches or pull requests

6 participants