Skip to content

Conversation

@cesarb
Copy link
Contributor

@cesarb cesarb commented Jan 17, 2017

No description provided.

@valarauca
Copy link
Owner

valarauca commented Jan 18, 2017

Going to have to deny this.

  1. Benches are depreciated

  2. This would make the crate nightly only again. I think if we're going to add nightly only features they should be placed behind a feature flag.

  3. A better approach would be criterion but if we're adding that it should be behind a feature flag as somebody importing this likely won't want to download a benchmark crate to build this crate. Also graphs are nice

@cesarb
Copy link
Contributor Author

cesarb commented Jan 18, 2017

This would make the crate nightly only again. I think if we're going to add nightly only features they should be placed behind a feature flag.

There's a trick to add benches without making a crate nightly-only, and without needing a feature flag. The benches/ directory is compiled only for cargo bench; if you put all your #[benches] code there, everything else (cargo test, cargo build, everyone who uses your crate as a dependency) keeps working on stable.

And that is exactly what I did. If for instance I use my distro's rustc 1.14.0 (which, of course, has no access to nightly features), cargo build and cargo test still work.

A better approach would be criterion but if we're adding that it should be behind a feature flag as somebody importing this likely won't want to download a benchmark crate to build this crate.

There's an easy solution for that too: use dev-dependencies instead of dependencies. The dev-dependencies are used only for tests and benches, not for someone importing the crate. See http://doc.crates.io/specifying-dependencies.html#development-dependencies for details.

Benches are depreciated

From what I understand, what we have there is just someone suggesting to deprecate benches, not benches being deprecated. But I see no problem using an alternative framework instead.

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

Successfully merging this pull request may close these issues.

2 participants