-
Notifications
You must be signed in to change notification settings - Fork 544
Add benchmarks. #244
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
Hi, thank you for bringing up this topic! I did not play with the bencher yet, mainly due to the nightly requirement but I am in favour of this. I think we would accept a PR if the purpose of the bench is clearly documented as not part of the main exercise and if it does not cause any trouble for people using stable rust. I am also curious how hard would be to modify the CI to compile the bench code only on nightly. I would not like to commit any code that is not checked by the CI framework. |
I am curious to see the result. I don't see a reason why not. Trying to see what we can do to make Travis run it. Worse case we can |
Thanks! I'll try to give this a shot tonight. I'm pretty familiar with Travis and imagine we can make it work. |
This is the rabbit hole that led me to create this issue. It's hard to create a parallel solution that's faster than for loops (even on large inputs). The
|
The Go concurrent example is actually faster than sequential (though slower than serial Rust; it's not filtering for alpha and normalizing like the Rust exercise tests require so not apples to apples):
|
I opened #245 with a benchmark for parallel-letter-frequency. |
Benchmark parallel-letter-frequency. Closes #244
I've been creating benchmarks for some exercises in the
benches
dir and testing withcargo bench
.Using test::Bencher, they would only work on nightly, but that could be documented easily enough and
cargo test
would still work fine on stable.This Go exercise is a pretty compelling reason to have that. Is your parallel implementation even faster than a simple sequential implementation? Find out:
https://github.com/exercism/xgo/blob/master/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go#L48-L58
Would a PR adding a benchmark to that example to start be accepted?
The text was updated successfully, but these errors were encountered: