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

Feature cleanup for bench crate #4120

Merged
merged 7 commits into from
Aug 2, 2023
Merged

Feature cleanup for bench crate #4120

merged 7 commits into from
Aug 2, 2023

Conversation

tinzh
Copy link
Contributor

@tinzh tinzh commented Jul 27, 2023

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 additive rustls and openssl default features. Originally, the historical-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.

@tinzh tinzh requested review from toidiu and jmayclin July 27, 2023 18:50
@tinzh tinzh marked this pull request as ready for review July 27, 2023 18:51
@@ -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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@tinzh tinzh requested a review from toidiu July 27, 2023 19:09
serde_json = { version = "1.0", optional = true }
semver = { version = "1.0", optional = true }

[dependencies.plotters]
Copy link
Contributor

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?

Copy link
Contributor Author

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

@tinzh tinzh enabled auto-merge (squash) August 2, 2023 00:03
@tinzh tinzh merged commit 4a973af into aws:main Aug 2, 2023
@tinzh tinzh deleted the feature-cleanup branch August 2, 2023 20:18
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.

3 participants