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

Add a high-level tutorial #79

Closed
llogiq opened this issue Jul 23, 2016 · 6 comments
Closed

Add a high-level tutorial #79

llogiq opened this issue Jul 23, 2016 · 6 comments

Comments

@llogiq
Copy link
Contributor

llogiq commented Jul 23, 2016

I'm missing some documentation on, say, migrating a "standard" benchmark to a criterion benchmark.

@Ygg01
Copy link

Ygg01 commented May 3, 2017

Hm. Could I be of assistance? I think I could write a docs for this.

@sourcefrog
Copy link

A few things I found confusing that might help to address in the readme

  • Should they live under benches/?
  • It looks like this only works on nightly, at least due to its dependencies
  • This is not yet on Crates.io, you have to add a git= dependency
  • How are you intended to run the benchmarks?
  • Is the idea that the benchmarks only write output to files and don't display it, and you have a separate program that displays it? Or, should this crate ship a binary that displays the output?

@bheisler
Copy link
Owner

Thanks for the comments. I think they're mostly addressed by the user guide I've added, but the short version is:

  • Yes, the benchmarks should live under benches/. It's a bit odd that they're marked with #[test], but hopefully we can find a way around that at some point.
  • Correct, Criterion-rs only works on nightly. That will continue for the foreseeable future, partly because it will take some work to refactor away much of the nightly-only code but mostly because it relies on the nightly-only test::black_box function (see the RFC to stabilize that).
  • Correct, Criterion-rs is not yet available on crates.io. I hope to make a release in the next few weeks.
  • You can run the benchmarks with the command cargo bench -- --test --nocapture. It's kind of awkward, and I hope to find a nicer way to do that.

With the addition of the user guide, I think this issue is satisfied, at least for the time being.

@sourcefrog
Copy link

sourcefrog commented Oct 10, 2017 via email

@llogiq
Copy link
Contributor Author

llogiq commented Oct 11, 2017

@bheisler regarding nightly, you may want to have a look at the bencher crate. This is but a workaround, but runs on stable and is good enough for many applications. You may want to consider adopting their technique (volatile write) and offer the nightly version as a feature. That way criterion-rs could benefit far more users while retaining the full functionality.

@bheisler
Copy link
Owner

Ah, I wasn't aware of the bencher crate. Thanks, I'll take a look.

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

No branches or pull requests

4 participants