forge
Explore
Log in

Don't you dare go Hollow

Dependencies are compiled optimised in dev too

Browse files at this commit

07b26bfedda5d0b0382adde0454c6ca200cbb4ebAhmet Kaan GümüşParent: a3051e6
  • perf
    • dependencies are compiled optimised in dev too
Show full message
⚡ perf(build): dependencies are compiled optimised in dev too

A dev build runs the same spreadsheet reader a release build does, and an
unoptimised quick-xml walks a wide sheet about twenty times slower: one page
of the 1,200-column book took 2.1s on `cargo run` against 94ms built for
release. Dependencies now build at opt-level 3 in the dev profile — the
workspace's own crates stay unoptimised, so an edit still rebuilds in a
second, and the same page now takes 410ms.

Costs one full rebuild of the dependency tree the next time dev is built.
Cargo.tomlmodified+8 -0
@@ -25,6 +25,14 @@ chacha20poly1305 = "0.10.1"
25 base64 = "0.22.1"25 base64 = "0.22.1"
26 toml = "1"26 toml = "1"
27 27
28+# A dev build runs the same spreadsheet reader a release build does, and an
29+# unoptimised quick-xml walks a wide sheet about twenty times slower — a page
30+# of a 1,200-column book took two seconds to open on `cargo run`. Dependencies
31+# are compiled optimised even in dev; the workspace's own crates stay
32+# unoptimised, so an edit still rebuilds in a second.
33+[profile.dev.package."*"]
34+opt-level = 3
35+
28 [profile.release]36 [profile.release]
29 codegen-units = 137 codegen-units = 1
30 lto = true38 lto = true