Skip to content

Commit

Permalink
Don't spend build time optimizing build-time-only crates
Browse files Browse the repository at this point in the history
Crates used exclusively at build time, such as proc-macro crates and
their dependencies, don't benefit substantially from optimization; they
take far longer to optimize than time saved when running them during the
build. No machine code from these crates will appear in the final
compiled binary.

Use the new profile-overrides mechanism in Rust 1.41
(https://doc.rust-lang.org/cargo/reference/profiles.html#overrides) to
build such crates with opt-level 0.

This substantially speeds up build time.
  • Loading branch information
joshtriplett committed Jul 12, 2020
1 parent 00f66c8 commit add2e3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ panic = 'abort'
codegen-units = 1
incremental = false

[profile.release.build-override]
opt-level = 0

[workspace]
members = [
"gitoxide-core",
Expand Down

0 comments on commit add2e3e

Please sign in to comment.