Skip to content

Investigate LLD Build Time Discrepancy #1147

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

Closed
theduke opened this issue Mar 9, 2021 · 4 comments
Closed

Investigate LLD Build Time Discrepancy #1147

theduke opened this issue Mar 9, 2021 · 4 comments
Labels
compile-time How fast is the code compiled

Comments

@theduke
Copy link

theduke commented Mar 9, 2021

As discussed on Zulip, build times with cg_clif appear to be consistently faster than llvm with ld, but slower with lld.

https://github.com/theduke/rustc-cranelift-bench/blob/main/timings.csv

@theduke theduke changed the title Investigate LLD Build Time Discrepancies Investigate LLD Build Time Discrepancy Mar 9, 2021
@bjorn3
Copy link
Member

bjorn3 commented Mar 15, 2021

I can reproduce this. While trying to repro I even found a rustc ICE: rust-lang/rust#83138

@bjorn3 bjorn3 added the compile-time How fast is the code compiled label Mar 15, 2021
@bjorn3
Copy link
Member

bjorn3 commented Mar 15, 2021

Excepts from -Ztime-passes:

cg_llvm:

time:   0.056; rss:   67MB ->  126MB (  +59MB)  configure_and_expand
time:   0.208; rss:  142MB ->  143MB (   +0MB)  link
time:   0.360; rss:   51MB ->  141MB (  +90MB)  total

cg_clif:

time:   0.201; rss:   51MB ->  276MB ( +224MB)  configure_and_expand
time:   0.149; rss:  154MB ->  150MB (   -4MB)  link
time:   0.455; rss:   45MB ->  101MB (  +56MB)  total

I think this is #927.

@bjorn3
Copy link
Member

bjorn3 commented Mar 15, 2021

With #927 implemented in b1d14ca, I get:

time:   0.104; rss:   50MB ->  130MB (  +81MB)  configure_and_expand
time:   0.155; rss:  135MB ->  132MB (   -4MB)  link
time:   0.379; rss:   44MB ->   94MB (  +51MB)  total

According to hyperfine cg_clif is now 8% slower than cg_llvm instead of the ~25% I believe it was before.

@bjorn3
Copy link
Member

bjorn3 commented Mar 27, 2021

I think the difference is small enough now.

@bjorn3 bjorn3 closed this as completed Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile-time How fast is the code compiled
Projects
None yet
Development

No branches or pull requests

2 participants