The performance gains are impressive in relative terms, but I don’t think I would ever switch the default linker if the potential gains are like shaving off 5 seconds when linking a 3GB bundle of binaries.
Mold: A Modern Linker
Submitted 1 year ago by ono@lemmy.ca to programming@programming.dev
Comments
rmam@programming.dev 1 year ago
ugo@feddit.it 1 year ago
At work we use lld as opposed ld. With ld, the project I work on links in 60-something seconds, with lld it links in less than 6.
Mold is faster than lld. It is absolutely worth it
verstra@programming.dev 1 year ago
Cool. Any idea how would i use this with rustc
AnarchoYeasty@beehaw.org 1 year ago
From their repo (github.com/rui314/mold#how-to-use)
Create .cargo/config.toml in your project directory with the following:
[target.x86_64-unknown-linux-gnu] linker = “clang” rustflags = [“-C”, “link-arg=-fuse-ld=/path/to/mold”] where /path/to/mold is an absolute path to the mold executable. In the example above, we use clang as a linker driver since it always accepts the -fuse-ld option. If your GCC is recent enough to recognize the option, you may be able to remove the linker = “clang” line.
[target.x86_64-unknown-linux-gnu] rustflags = [“-C”, “link-arg=-fuse-ld=/path/to/mold”] If you want to use mold for all projects, add the above snippet to ~/.cargo/config.toml
fubo@lemmy.world 1 year ago
Parallelize all the things! 🧹
PriorProject@lemmy.world 1 year ago
I read the design notes and found them pretty interesting even though I haven’t really been pining for a faster linker: github.com/rui314/mold/blob/main/docs/design.md