ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/Cargo.toml

10 lines
165 B
TOML
Raw Normal View History

cargo-features = []
2022-04-01 06:44:28 +00:00
[workspace]
resolver = "2"
members = ["cli", "lib", "lib/testutils", "lib/gen-protos"]
feat(cargo): improve --release binary size Summary: On x86_64-linux, these options reduce the total number of bytes in the `jj` binary by 40 percent, from 16MiB to 9.8MiB, while having relatively minimal impact on build time, going from 58s to 1m15s. While `strip=debuginfo` is already the default, `codegen-units=1` is doing all the work here, and seems to have a rather miraculous effect despite not meaningfully hurting compile time too much for me at least. This actually will probably improve performance in some cases too, but it's likely hard to quantify. Ultimately, with or without this change, the dominant entity taking up most of the compile time for the whole project is `jj-lib` and `jj-cli` crates. A `--timings` report with Cargo indicates almost all dependencies (on my machine) compile within 30s whether or not this change is in play, so the remaining time is all on us. Various other changes, such as using `opt-level=z` or `lto=thin`, had no real visible effect. `lto=fat` was pretty successful, reducing total bytes by over 50% (7.8MiB), but at a nearly 2x link-time cost. It *might* be worth exploring if something like `lto=thin` could improve performance since it didn't meaningfully impact compile time or size any further, but that's TBD. Note: these numbers were performed with a wiped `target/` directory after each run, and so all dependencies were compiled from scratch, on my 12-core Ryzen 5600X. Signed-off-by: Austin Seipp <aseipp@pobox.com> Change-Id: Ioyoulrmtwxypsrwwwysyylvmqxzttkmn
2023-07-10 03:54:40 +00:00
[profile.release]
strip = "debuginfo"
codegen-units = 1