-
Notifications
You must be signed in to change notification settings - Fork 722
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
Feature cleanup for bench crate #4120
Conversation
@@ -19,13 +19,17 @@ certs/generate_certs.sh | |||
cargo bench --config aws-lc-config/s2n.toml | |||
``` | |||
|
|||
### Features | |||
|
|||
Default features (`rustls` and `openssl`) can be disabled by running the benches with `--no-default-features`. The non-default `memory` and `historical-perf` features are used to enable dependencies specific to those types of benches, and are automatically used by the scripts that run those benches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prob dont need this section. Features are pretty well defined in the cargo docs so I dont think we need to explain it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be good for someone that usually uses C but wants to do benching, but I don't have strong opinions on it.
serde_json = { version = "1.0", optional = true } | ||
semver = { version = "1.0", optional = true } | ||
|
||
[dependencies.plotters] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than breaking this out into a separate table, could we keep using the inline syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but the line would be way too long. Criterion does the same with breaking it out: https://github.com/bheisler/criterion.rs/blob/master/Cargo.toml#L47
Description of changes:
The bench crate has a lot of dependencies that in reality only need to be loaded for certain functionalities. This PR adds feature logic to all of the dependencies.
Call-outs:
I decided to unwrap the subtractive
historical-perf
feature into additiverustls
andopenssl
default features. Originally, thehistorical-perf
feature was included because using--no-default-features
just for historical benching performance felt weird and nonobvious, but separating it out has started to make more sense, especially considering that if run in CI--no-default-features
to remove rustls and openssl benching might be run more frequently.Testing:
To test this change, run all of the benches, scripts, and binaries, with and without default features. No behaviour should have changed, and this can be confirmed by running benches before and after the changes in this PR.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.