bcs: clean deps, reduce CI clean build time#14
Open
phlip9 wants to merge 2 commits intozefchain:mainfrom
Open
Conversation
`bcs` only uses proc-macro serde derives in tests. We can reduce compile times by using `serde_core` directly, which only exports the core serde traits.
Before:
```
$ cargo tree --edges build,normal
bcs v0.1.6 (/home/phlip9/dev/bcs)
├── serde v1.0.228
│ ├── serde_core v1.0.228
│ └── serde_derive v1.0.228 (proc-macro)
│ ├── proc-macro2 v1.0.106
│ │ └── unicode-ident v1.0.24
│ ├── quote v1.0.45
│ │ └── proc-macro2 v1.0.106 (*)
│ └── syn v2.0.117
│ ├── proc-macro2 v1.0.106 (*)
│ ├── quote v1.0.45 (*)
│ └── unicode-ident v1.0.24
└── thiserror v1.0.69
└── thiserror-impl v1.0.69 (proc-macro)
├── proc-macro2 v1.0.106 (*)
├── quote v1.0.45 (*)
└── syn v2.0.117 (*)
$ rm -rf /tmp/cargo-target && taskset -c 3 cargo build --target-dir /tmp/cargo-target --lib
Finished dev [unoptimized + debuginfo] target(s) in 7.89s
```
After:
```
$ cargo tree --edges build,normal
Updating crates.io index
bcs v0.1.6 (/home/phlip9/dev/bcs)
└── serde_core v1.0.228
$ rm -rf /tmp/cargo-target && taskset -c 3 cargo build --target-dir /tmp/cargo-target --lib
Compiling serde_core v1.0.228
Compiling bcs v0.1.6 (/home/phlip9/dev/bcs)
Finished dev [unoptimized + debuginfo] target(s) in 1.38s
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey!
I noticed
bcson the critical path of abuild.rsscript in CI, so I took a pass at fixing that. After some slight refactoring to (1) removethiserrorand (2) useserde_coretraits directly, the "1 vCPU in CI" clean build time is down ~5.7x, without many downsides:Before:
After: