meta: Use mold as linker #451

Open
derppening wants to merge 1 commits from misc/mold into master
Collaborator

Tested by cargo build --all --tests on a clean directory.

Ryzen 7 6850U:

ld: 349.96user 31.11system 0:52.96elapsed 719%CPU (0avgtext+0avgdata 983032maxresident)k
mold: 339.10user 26.82system 0:49.64elapsed 737%CPU (0avgtext+0avgdata 1002016maxresident)k

Ryzen 9 5900X:

ld: 186.05user 17.59system 0:32.98elapsed 617%CPU (0avgtext+0avgdata 1021228maxresident)k
mold: 183.31user 14.95system 0:31.04elapsed 638%CPU (0avgtext+0avgdata 1044292maxresident)k

Sidenote: I am not sure whether I am putting the packages/stdenv overrides at the right place in flake.nix. Would appreciate if someone can review it.

Tested by `cargo build --all --tests` on a clean directory. Ryzen 7 6850U: ``` ld: 349.96user 31.11system 0:52.96elapsed 719%CPU (0avgtext+0avgdata 983032maxresident)k mold: 339.10user 26.82system 0:49.64elapsed 737%CPU (0avgtext+0avgdata 1002016maxresident)k ``` Ryzen 9 5900X: ``` ld: 186.05user 17.59system 0:32.98elapsed 617%CPU (0avgtext+0avgdata 1021228maxresident)k mold: 183.31user 14.95system 0:31.04elapsed 638%CPU (0avgtext+0avgdata 1044292maxresident)k ``` Sidenote: I am not sure whether I am putting the packages/stdenv overrides at the right place in `flake.nix`. Would appreciate if someone can review it.
derppening requested review from sb10q 2024-07-08 12:40:49 +08:00
Owner

Not sure if this is worth the extra code, complexity, and potential bugs...

Not sure if this is worth the extra code, complexity, and potential bugs...
Author
Collaborator

Updated stats using cargo build --all-targets on a clean directory.

Ryzen 7 6850U:

ld: 388.20user 33.36system 0:54.27elapsed 776%CPU (0avgtext+0avgdata 958444maxresident)k
mold: 365.84user 26.51system 0:50.18elapsed 781%CPU (0avgtext+0avgdata 972560maxresident)k

Ryzen 9 5900X:

ld: 202.71user 20.43system 0:33.52elapsed 665%CPU (0avgtext+0avgdata 1014964maxresident)k
mold: 195.02user 16.24system 0:31.20elapsed 677%CPU (0avgtext+0avgdata 1045960maxresident)k

Do you think it might be better if we only merge the changes to flake.nix so that people can opt into mold rather than enforcing it for everyone?

Updated stats using `cargo build --all-targets` on a clean directory. Ryzen 7 6850U: ``` ld: 388.20user 33.36system 0:54.27elapsed 776%CPU (0avgtext+0avgdata 958444maxresident)k mold: 365.84user 26.51system 0:50.18elapsed 781%CPU (0avgtext+0avgdata 972560maxresident)k ``` Ryzen 9 5900X: ``` ld: 202.71user 20.43system 0:33.52elapsed 665%CPU (0avgtext+0avgdata 1014964maxresident)k mold: 195.02user 16.24system 0:31.20elapsed 677%CPU (0avgtext+0avgdata 1045960maxresident)k ``` Do you think it might be better if we only merge the changes to `flake.nix` so that people can opt into mold rather than enforcing it for everyone?
derppening force-pushed misc/mold from ffe42a67ea to c03743e9b0 2024-07-09 14:06:28 +08:00 Compare
derppening force-pushed misc/mold from c03743e9b0 to 7d40808c12 2024-08-28 16:34:44 +08:00 Compare
derppening force-pushed misc/mold from 7d40808c12 to 8f21c33f5b 2024-09-11 16:39:20 +08:00 Compare
derppening force-pushed misc/mold from 8f21c33f5b to e134f4888b 2025-01-24 11:29:35 +08:00 Compare
Author
Collaborator

Rebased onto master, made mold opt-in by users and added a section in README to explain how to opt into using mold.

Stats with current master with a Ryzen 7 6850U:

cargo build --all-targets
ld: 422.70user 41.24system 0:55.87elapsed 830%CPU (0avgtext+0avgdata 895024maxresident)k
mold: 402.81user 32.88system 0:51.85elapsed 840%CPU (0avgtext+0avgdata 815356maxresident)k
Speedup: 7.8%

./check_demos.sh --debug -- -O0
ld: 13.84user 4.15system 0:18.16elapsed 99%CPU (0avgtext+0avgdata 109960maxresident)k
mold: 12.94user 3.63system 0:17.04elapsed 97%CPU (0avgtext+0avgdata 109760maxresident)k
Speedup: 7.0%

./check_demos.sh --debug -- -O2
ld: 21.49user 4.35system 0:26.07elapsed 99%CPU (0avgtext+0avgdata 121540maxresident)k
mold: 18.72user 3.62system 0:22.83elapsed 97%CPU (0avgtext+0avgdata 120968maxresident)k
Speedup: 14.2%

Note that mold cannot be used for run_demo.sh in 32-bit mode.

Rebased onto master, made `mold` opt-in by users and added a section in README to explain how to opt into using mold. Stats with current `master` with a Ryzen 7 6850U: ``` cargo build --all-targets ld: 422.70user 41.24system 0:55.87elapsed 830%CPU (0avgtext+0avgdata 895024maxresident)k mold: 402.81user 32.88system 0:51.85elapsed 840%CPU (0avgtext+0avgdata 815356maxresident)k Speedup: 7.8% ./check_demos.sh --debug -- -O0 ld: 13.84user 4.15system 0:18.16elapsed 99%CPU (0avgtext+0avgdata 109960maxresident)k mold: 12.94user 3.63system 0:17.04elapsed 97%CPU (0avgtext+0avgdata 109760maxresident)k Speedup: 7.0% ./check_demos.sh --debug -- -O2 ld: 21.49user 4.35system 0:26.07elapsed 99%CPU (0avgtext+0avgdata 121540maxresident)k mold: 18.72user 3.62system 0:22.83elapsed 97%CPU (0avgtext+0avgdata 120968maxresident)k Speedup: 14.2% ``` Note that mold cannot be used for `run_demo.sh` in 32-bit mode.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin misc/mold:misc/mold
git checkout misc/mold
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#451
No description provided.