Skip to content

Add clap-3.1.6 as a new benchmark. #1217

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

Merged
merged 2 commits into from
Mar 23, 2022
Merged

Conversation

nnethercote
Copy link
Contributor

This is a little faster to compile than the old clap-rs benchmark.

        clap-rs   clap-3.1.6
check   3.17s     2.78s
debug   4.44s     4.00s
opt     5.79s     5.16s

clap-rs will be removed soon.

This is a little faster to compile than the old `clap-rs` benchmark.
```
        clap-rs   clap-3.1.6
check   3.17s     2.78s
debug   4.44s     4.00s
opt     5.79s     5.16s
```
`clap-rs` will be removed soon.
Copy link
Member

@rylev rylev left a comment

Choose a reason for hiding this comment

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

The derive feature is heavily used (having superseded the structopt crate. I wonder if including that would be useful though that might skew the benchmark heavily towards proc macro benchmarking.

@nnethercote
Copy link
Contributor Author

The derive feature is heavily used (having superseded the structopt crate. I wonder if including that would be useful though that might skew the benchmark heavily towards proc macro benchmarking.

Interesting idea. I tried enabling the derive feature by default like so:

diff --git a/collector/benchmarks/clap-3.1.6/Cargo.toml b/collector/benchmarks/clap-3.1.6/Cargo.toml
index 6fdaa1a5..24d4d1df 100644
--- a/collector/benchmarks/clap-3.1.6/Cargo.toml
+++ b/collector/benchmarks/clap-3.1.6/Cargo.toml
@@ -413,7 +413,7 @@ default-features = false
 cargo = ["lazy_static"]
 color = ["atty", "termcolor"]
 debug = ["clap_derive/debug", "backtrace"]
-default = ["std", "color", "suggestions"]
+default = ["std", "color", "suggestions", "derive"]
 derive = ["clap_derive", "lazy_static"]
 env = []
 std = ["indexmap/std"]

It certainly affected overall compile time, due to the proc-macro2 and syn dependencies being added:

      default  w/derive
check  2.7s     7.1s
debug  4.0s     8.4s
opt    5.1s     8.9s

But for the final crate itself the change in compile times was well under 1%. I think you would see the effect of the derive feature in crates that depend on clap, rather than clap itself. So I'll stick with the original code.

@rylev rylev merged commit a1e07c1 into rust-lang:master Mar 23, 2022
@nnethercote nnethercote deleted the add-clap-3.1.6 branch March 23, 2022 20:26
@nnethercote nnethercote mentioned this pull request Mar 23, 2022
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