Skip to content

Enable LTO and reduce code generation units for release profile#438

Open
Integral-Tech wants to merge 1 commit into
KSXGitHub:masterfrom
Integral-Tech:enable-lto
Open

Enable LTO and reduce code generation units for release profile#438
Integral-Tech wants to merge 1 commit into
KSXGitHub:masterfrom
Integral-Tech:enable-lto

Conversation

@Integral-Tech
Copy link
Copy Markdown
Contributor

According to The rustc book:

codegen-units

This flag controls the maximum number of code generation units the crate is split into. It takes an integer greater than 0.

When a crate is split into multiple codegen units, LLVM is able to process them in parallel. Increasing parallelism may speed up compile times, but may also produce slower code. Setting this to 1 may improve the performance of generated code, but may be slower to compile.

The default value, if not specified, is 16 for non-incremental builds. For incremental builds the default is 256 which allows caching to be more granular.

@KSXGitHub
Copy link
Copy Markdown
Owner

Can you benchmark it?

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.

2 participants