Skip to content

Conversation

@rsheeter
Copy link
Contributor

Exploratory adjustment based on #1359.

Tested locally the impact on size and compile time is significant:

$ cargo clean && rm -rf build/ target/
$ time cargo build -p fontc --release
# branch real	2m41.823s
# main   real	0m37.618s
$ ls -l target/release/fontc | awk '{print $5" "$9}'
# branch 13048376 target/release/fontc
# main   19544344 target/release/fontc

@behdad
Copy link

behdad commented Mar 21, 2025

What would lto = true do?

@rsheeter
Copy link
Contributor Author

What would lto = true do?

It's an alias for fat, https://doc.rust-lang.org/rustc/codegen-options/index.html#lto. true seems less clear to me given that there are multiple significantly different ways for lto to be turned on.

@cmyr
Copy link
Member

cmyr commented Mar 21, 2025

I agree that this would make sense for binaries that we're shipping, but less clear that it's good for all release builds? For instance crater always does a release build, and making that take two extra minutes every time has a real cost (particularly when I'm paying it to run locally on a smaller set of fonts, which might only take a couple of minutes already)

@rsheeter
Copy link
Contributor Author

Good point. Maybe we should make the binary production for releases use a custom profile? Or ... given that the intuitive interpretation of release is that it's the one to release perhaps we should flip that and have crater use a crater-specific profile?

@cmyr
Copy link
Member

cmyr commented Mar 25, 2025

It looks like we can have profiles inherit from other profiles, and their example is a release-lto profile: https://doc.rust-lang.org/1.85.1/cargo/reference/profiles.html#custom-profiles

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.

3 participants