8000 Enable Link-Time Optimization (LTO) and codegen-units = 1 · Issue #1413 · googlefonts/fontations · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable Link-Time Optimization (LTO) and codegen-units = 1 #1413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zamazan4ik opened this issue Mar 20, 2025 · 0 comments
Open

Enable Link-Time Optimization (LTO) and codegen-units = 1 #1413

zamazan4ik opened this issue Mar 20, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@zamazan4ik
Copy link

Hi!

It's an issue very similar to googlefonts/fontc#1359 about enabling LTO and codegen-units = 1 optimizations for the project. Motivation is also the same: more aggressive optimizations and smaller binary sizes. I found other benchmarks about LTO like #1171 and #1172 - also with positive results.

I have made quick tests (AMD Ryzen 5900x, Fedora 41, Rust 1.85.1, the latest version of the project at the moment, cargo build --release command) - here are the results. I don't know which binaries are more or less important, so I report several binaries (that seems like the most important but I could be wrong here).

Binary\Build mode fauntlet klippa otexplorer codegen
Release 3.1 Mib 4.3 Mib 1.3 Mib 7.7 Mib
Release + codegen-units = 1 + ThinLTO 2.6 Mib 3.4 Mib 1.1 Mib 6.4 Mib
Release + codegen-units = 1 + FatLTO 2.4 Mib 3.0 Mib 1 Mib 5.5 Mib

I didn't post results for the fuzz_* binaries since they are not important much from binary size perspective but enabling LTO for fuzzing purposes could help with performing faster fuzzing.

Clean build times:

  • Release: 22s
  • Release + codegen-units = 1 + ThinLTO: 34s
  • Release + codegen-units = 1 + FatLTO: 42s

Thank you.

@rsheeter rsheeter added the enhancement New feature or request label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
0