Live data from Hacker News

Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

twitter.com

31–40 of 120 posts

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#31
post #7

Earlier quoted context omitted.

The biggest reason is because it is multi-threaded. When building a program, the compilation step is parallelized (the build system invokes a compiler for each source file), but the final link step is not. So it is important to make the linker itself multi-threaded. But even without multi-threading, mold is still faster than other linkers. I can think of various reasons why, but I don't know which attributes how much…

Note that recent lld is also multithreaded, and with tweaks, can be faster than mold at low core counts: https://bugzilla.mozilla.org/show_bug.cgi?id=1746462#c2

I wouldn't be surprised. In mold, if we have more than one choices to implement a feature, I always take the one that scales well for more cores even if it doesn't perform the best on low-core count machines.

My assumption is that future machines will have more cores than we have today on average, so I'm optimizing mold for such computers.

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#32
post #29

Great achievement, does it support all deployment targets, build configurations for Swift and Objective-C?

mold/macOS aims to be a drop-in replacement for the Apple's ld. I don't think it supports all the feature you mentioned already, as it is still pre-Alpha. But we are working on it to make it "just work".

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#33
post #2

Author here. If you have any questions about mold/macOS, feel free to ask me as a reply.

Does mold support jobserver or some other mechanism to throttle threads?

We use lld currently but had to disable threading as sometimes in CI several of our test binaries would get linked at the same time. Whenever this happened the lld instances appear to have spawned enough threads to overload our Jenkins slave to the point that the master wasn't able to reach it and failed the build.

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#34
post #26
post #2

Author here. If you have any questions about mold/macOS, feel free to ask me as a reply.

Do you have any plans for supporting other binary executable file formats?

We do support ELF (Unix) already, and we are working on Mach-O (macOS/iOS/watchOS/etc) now. Once Mach-O is finished, we'll be working on PE/COFF (Windows).

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#36
post #30
post #22

Earlier quoted context omitted.

I sort of wish Apple, Amazon, Google, Microsoft and Facebook all contribute $200K each and say hey can you now make Mold MIT or BSD.

$200K is nowadays an annual total compensation of a junior dev. I believe mold values much more than a one year outcome of a typical 5-person junior dev team.

I am sorry I was not trying to undermine the value of Mold. I was told the average / median of Junior Dev are't even $200K in FAANG. But then I dont work in the US so I dont know.

( I hope more US companies are opened to truly remote )

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#37
post #33
post #2

Author here. If you have any questions about mold/macOS, feel free to ask me as a reply.

Does mold support jobserver or some other mechanism to throttle threads? We use lld currently but had to disable threading as sometimes in CI several of our test binaries would get linked at the same time. Whenever this happened the lld instances appear to have spawned enough threads to overload our Jenkins slave to the point that the master wasn't able to reach it and failed the build.

It's being discussed (https://github.com/rui314/mold/issues/117) but haven't reached any conclusion. The problem is that the jobserver protocol assumes that one process is one job, and its model doesn't fit very well to programs such as mold.

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#38
post #35
post #2

Author here. If you have any questions about mold/macOS, feel free to ask me as a reply.

do you have a plan to supersede official linkers in gcc/ llvm?

I don't have a plan, and that's not what I can plan. They can plan in theory, but I believe that's very unlikely to happen.

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#39
post #36
post #30

Earlier quoted context omitted.

$200K is nowadays an annual total compensation of a junior dev. I believe mold values much more than a one year outcome of a typical 5-person junior dev team.

I am sorry I was not trying to undermine the value of Mold. I was told the average / median of Junior Dev are't even $200K in FAANG. But then I dont work in the US so I dont know. ( I hope more US companies are opened to truly remote )

I didn't take it as an offense, so don't say sorry! I just wanted to say that if a senior dev wants to earn $1M in a few years, they can just find a job and do whatever assigned to them there. They didn't have to take a risk of starting a completely new ambitious open-source project to earn that much.

Re: Mold/macOS is 11 times faster than the Apple's default linker to link Chrome

#40
post #38
post #35

Earlier quoted context omitted.

do you have a plan to supersede official linkers in gcc/ llvm?

I don't have a plan, and that's not what I can plan. They can plan in theory, but I believe that's very unlikely to happen.

if mold has multiple advantages over the official ones and no drawback, can't you send them an RFC once mold reaches 1.0?
Post reply on HN