Skip to content
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

Evaluate LTO #719

Closed
bolinfest opened this issue Nov 5, 2019 · 3 comments
Closed

Evaluate LTO #719

bolinfest opened this issue Nov 5, 2019 · 3 comments

Comments

@bolinfest
Copy link

Consider adding the following to Cargo.toml to improve performance / reduce binary size:

[profile.release]
lto = true
@sharkdp
Copy link
Owner

sharkdp commented Dec 22, 2019

Benchmark on a random subset of files in the bat repo.

Command Mean [ms] Min [ms] Max [ms] Relative
./bat-no-lto --color=always src/*.rs README.md Cargo.toml 231.8 ± 2.2 227.4 235.3 1.09 ± 0.01
./bat-lto --color=always src/*.rs README.md Cargo.toml 213.5 ± 1.8 209.7 216.1 1.00

That's a solid 10% speedup. Nice.

Compile time (release build from scratch, including all dependencies):

  • without LTO: 2min 31sec
  • with LTO: 3min 7sec

@sharkdp
Copy link
Owner

sharkdp commented Mar 22, 2020

This has been released in bat 0.13.

@tbillington
Copy link

@sharkdp You may be able to reduce the compile time hit with thin over true/fat, though probably should bench that first 😀

https://doc.rust-lang.org/cargo/reference/profiles.html#lto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants