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

Use criterion.rs instead of libtest for benchmarks. #119

Merged
merged 1 commit into from
Mar 26, 2018

Conversation

hdevalence
Copy link
Contributor

Since Criterion can only benchmark public API, these changes just drop
all internal benchmarks (e.g., benchmarks for field operations). But
those are usually microbenchmarks whose meaning is kind of questionable
anyways, so I don't think this is a big loss.

The bench feature disappears, since Criterion works on stable Rust.

Since Criterion can only benchmark public API, these changes just drop
all internal benchmarks (e.g., benchmarks for field operations). But
those are usually microbenchmarks whose meaning is kind of questionable
anyways, so I don't think this is a big loss.

The `bench` feature disappears, since Criterion works on stable Rust.
@isislovecruft
Copy link
Member

Everything else looks good though.

@@ -60,7 +65,6 @@ default = ["std"]
std = ["rand", "subtle/std"]
alloc = []
yolocrypto = ["avx2_backend"]
bench = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove the "bench" feature, will all the dev-dependencies being pulled in by criterion also be required when we run cargo test? Also this is going to be a lot of code to pull in, it'd be nice to have a way to turn it off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all the dev dependencies are pulled in for tests and benchmarks, but are excluded from library users. I would rather not have a bench feature -- I'm glad to be able to get rid of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as someone is using curve25519-dalek as a library, they won't be using any of its dev dependencies, only its actual dependencies. So feature-gating them would only save code for people who want to make changes to curve25519-dalek itself, but don't want to run benchmarks. Since the dependencies are cached, this is basically a one-time savings.

@isislovecruft isislovecruft dismissed their stale review March 26, 2018 02:11

Doesn't apply when running cargo test.

@hdevalence hdevalence merged commit ed4b1c6 into dalek-cryptography:develop Mar 26, 2018
@hdevalence hdevalence deleted the feature/criterion branch March 26, 2018 02:42
pinkforest pushed a commit to pinkforest/curve25519-dalek that referenced this pull request Jun 27, 2023
pinkforest pushed a commit to pinkforest/curve25519-dalek that referenced this pull request Jun 27, 2023
Fix `no std` by moving `get_random` feat dev-deps
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