Merged
Conversation
Owner
|
Thanks for the well thought out PR! This looks great, and I'll look deeply into it once I get back from work. Compilation times on release mode are not too bad of a price to pay here since that's mostly done on a (github) release only :) |
Owner
|
Looks great, thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to reduce the size of the compiled
dotterbinary. I'm taking your advice and including the final binary in my dotfiles but I thought the final binary size was a bit larger than I'd like. I followed the steps here and reduced the file size from 17M to 4.9M.This PR adds 5 new flags to the release profile in Cargo.toml:
strip = true: strip symbolsopt-level = "z": optimize for file size instead of execution speed (more below)lto = true: enable Link Time Optimizationcodegen-units = 1: reduces parallel codegen units from 16 to 1panic = "abort": prevents unwinding the stack on a panic and prevents displaying a stacktraceThe
stripandltooptimizations have no downsizes but the others have some potential negative effects.Impact on File Size
Impact on Execution Time
opt-levelcan potentially increase execution time. However, I benchmarkedcargo test --releaseusinghyperfineand found that there were almost no difference in test time.hyperfine "cargo test --release"Impact on Build Time
codegen-units = 1can slow down build times. In my testing, I was building from a clean repo for each run so build times are pretty long. But I think build times will be impacted much less when using cached builds.I'm not sure if there's any interest for this kind of PR but I thought I'd throw it out there. Thanks for you review.