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

refactor: Split out clap_builder for faster derive builds #4791

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

epage
Copy link
Member

@epage epage commented Mar 27, 2023

For now, we are still treating clap as the user facing API for both builder and derive, making this an internal change as we don't expect this to negatively impact builder build times all that much. We can re-evaluate at a later time and consider having distinct top-level crates for builder and derive.

Looking at --timings on my machine

  • clap only took 0.04s to build and it happened in parallel to clap_builder codegen
  • this saved 1.7s for derive build times, with clap_builder building in parallel to syn and clap_builder and clap_derive finishing around the same time.

This was discussed some at https://rust-lang.zulipchat.com/#narrow/stream/220302-wg-cli/topic/clap.20build.20times.20and.20.60clap_derive.60.3A.20a.20crazy.20idea

For now, we are still treating `clap` as the user facing API for both
builder and derive, making this an internal change as we don't expect
this to negatively impact builder build times all that much.  We can
re-evaluate at a later time and consider having distinct top-level
crates for builder and derive.

Looking at `--timings` on my machine
- `clap` only took 0.04s to build and it happened in
  parallel to `clap_builder` codegen
- this saved 1.7s for derive build times, with `clap_builder` building
  in parallel to `syn` and `clap_builder` and `clap_derive` finishing
  around the same time.

This was discussed some at https://rust-lang.zulipchat.com/#narrow/stream/220302-wg-cli/topic/clap.20build.20times.20and.20.60clap_derive.60.3A.20a.20crazy.20idea
@epage epage force-pushed the builder branch 5 times, most recently from ad14b40 to 4e1a565 Compare March 27, 2023 16:22
@epage epage merged commit 9712987 into clap-rs:master Mar 27, 2023
@epage epage deleted the builder branch March 27, 2023 16:32
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.

1 participant