Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mold/design.md at main · rui314/mold (github.com/rui314)
2 points by jasim on Dec 15, 2021 | hide | past | favorite | 2 comments


I'm truly curious how many of these options (especially multithreading) were on the table 10+ years ago when GOLD was written?

I'm curious because I sat through many slow C++ links at Google thinking "hmm, seems like the linker could be faster if it used more CPU, because it's not IO bound" and then thinking "nahh, the folks who wrote GOLD knew what they were doing and made it 'as fast as reasonably possible'.

And I just checked, GOLD has had a threads option for years but apparently it wasn't enabled?


gold is multi-threaded but its implementation didn't scale well for multicore, so in many cases, multi-threading simply disabled.

Internally, gold is organized as a collection of "tasks". For example, there are tasks to read symbol tables and tasks to parse symbol tables. They form a dependency graph, and the gold's scheduler reduces the graph by executing them, possibly in parallel. It's essentially the same as what the make command does. It didn't scale well for some reason, though.

For more details, read https://static.googleusercontent.com/media/research.google.c...

mold employs data paralellism instead of task-based paralellism. As I described in the doc, we use simple parallel-for loops. It looks like it scales pretty well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: