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

Run benchmarks just once when --bench isn't specified #14

Open
asomers opened this issue Dec 18, 2018 · 2 comments
Open

Run benchmarks just once when --bench isn't specified #14

asomers opened this issue Dec 18, 2018 · 2 comments

Comments

@asomers
Copy link

asomers commented Dec 18, 2018

cargo bench will execute each target with the --bench flag. cargo test, however, does not pass that flag. The builtin libtest crate takes advantage of that by only running each benchmark exactly once and not gathering statistics if --bench isn't passed. That means cargo test --all-targets can be used to ensure that the benchmarks run successfully, and it's much faster than doing cargo bench.

@bluss
Copy link
Owner

bluss commented Dec 18, 2018

Sounds good. Do you want to make a pull request? And we can exercise this in travis.

@asomers
Copy link
Author

asomers commented Dec 19, 2018

Probably not. I'm not actually using bencher at the moment. I just evaluated it and noticed this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants