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

Add an option to use LLD to link the compiler on Windows platforms #68623

Merged
merged 5 commits into from
Feb 9, 2020

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Jan 29, 2020

Based on #68609.

Using LLD is good way to improve compile times on Windows since link.exe is quite slow. The time for x.py build --stage 1 src/libtest goes from 0:12:00 to 0:08:29. Compile time for rustc_driver goes from 226.34s to 18.5s. rustc_macros goes from 28.69s to 7.7s. The size of rustc_driver is also reduced from 83.3 MB to 78.7 MB.

r? @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 29, 2020
src/bootstrap/builder.rs Outdated Show resolved Hide resolved
src/bootstrap/lib.rs Show resolved Hide resolved
@est31
Copy link
Member

est31 commented Jan 30, 2020

I wonder about the impact on rustc's performance when it was linked with LLD vs MSVC's link.exe. The Microsoft linker is known for being good at optimizations so maybe it might be faster. Can perf runs run on Windows?

@retep998
Copy link
Member

retep998 commented Jan 30, 2020

I don't think perf runs should block this PR since it is just adding LLD as an option although if we ever did want to change the default then we'd absolutely need perf runs, and I'd be interested to see the results regardless.

@est31
Copy link
Member

est31 commented Jan 30, 2020

@retep998 full agree. This PR should be merged in any case. My question should not be interpreted as criticism, quite the contrary. The earlier we have performance comparisons, the earlier we can switch to LLD as default if it's faster in the benchmarks (or figure out how to make it faster if it's not).

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2020
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 9, 2020

📌 Commit d304cd0 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 9, 2020
@bors
Copy link
Contributor

bors commented Feb 9, 2020

⌛ Testing commit d304cd0 with merge 1ad6b5e...

bors added a commit that referenced this pull request Feb 9, 2020
Add an option to use LLD to link the compiler on Windows platforms

Based on #68609.

Using LLD is good way to improve compile times on Windows since `link.exe` is quite slow. The time for `x.py build --stage 1 src/libtest` goes from 0:12:00 to 0:08:29. Compile time for `rustc_driver` goes from 226.34s to 18.5s. `rustc_macros` goes from 28.69s to 7.7s. The size of `rustc_driver` is also reduced from 83.3 MB to 78.7 MB.

r? @Mark-Simulacrum
@bors
Copy link
Contributor

bors commented Feb 9, 2020

☀️ Test successful - checks-azure
Approved by: Mark-Simulacrum
Pushing 1ad6b5e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 9, 2020
@bors bors merged commit d304cd0 into rust-lang:master Feb 9, 2020
@Zoxc Zoxc deleted the lld branch February 9, 2020 19:36
@michaelwoerister
Copy link
Member

Fwiw, official Windows builds of Firefox are all done with LLD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants