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

Using mold breaks sccache? #1755

Open
cgbur opened this issue May 4, 2023 · 2 comments
Open

Using mold breaks sccache? #1755

cgbur opened this issue May 4, 2023 · 2 comments

Comments

@cgbur
Copy link

cgbur commented May 4, 2023

I saw #1410 which did not resolve the issue. I was using sccache and it was working great, then when I added mold, which works independently fine, sccache no longer is able to cache and build times do not decrease. A second question if you look at the times here, sccache really hurts clean build performance. Is this expected?

[build]
rustc-wrapper = "/home/NAME/.cargo/bin/sccache"

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold"]

No Mold, Sccache

cargo clean
time cargo build -r
________________________________________________________
Executed in   28.16 secs    fish           external
   usr time   54.73 secs  526.00 micros   54.73 secs
   sys time   10.53 secs   46.00 micros   10.53 secs

second run

cargo clean
time cargo build -r
________________________________________________________
Executed in    9.43 secs    fish           external
   usr time   50.86 secs  468.00 micros   50.86 secs
   sys time    9.87 secs   41.00 micros    9.87 secs

Mold, No Sccache

Also, why does sccache hurt clean build performance by so much?

cargo clean
time cargo build -r
______________________________________________________
Executed in   17.51 secs    fish           external
   usr time  312.08 secs    0.00 micros  312.08 secs
   sys time   20.15 secs  562.00 micros   20.15 secs

Mold, Sccache

Clearing the cache adds X mb to it, each run with mold adds another X like nothing is being reused.

cargo clean
time cargo build -r
________________________________________________________
Executed in   26.77 secs    fish           external
   usr time   45.49 secs  615.00 micros   45.49 secs
   sys time    8.25 secs    0.00 micros    8.25 secs


cargo clean
time cargo build -r

________________________________________________________
Executed in   28.16 secs    fish           external
   usr time   54.73 secs  526.00 micros   54.73 secs
   sys time   10.53 secs   46.00 micros   10.53 secs
@awoimbee
Copy link

Posting my (very unscientific) conclusion from the CI runs in Trow-Registry/trow#361:
previous run with mold + sccache: 1m49s
no mold run 1: 3m2s
no mold run 2: 2m2s

Quick conclusion: mold + sccache is doing it's job, #1755 doesn't apply here

@BatmanAoD
Copy link

@awoimbee Don't you also need to compare the performance for an uncached mold build?

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

No branches or pull requests

3 participants