mold: A Massively Parallel Linker
summary
The gist
Linking is a critical step in the software build process that combines compiled object files into a single executable or shared library <ref:2608.23228#pg2> Despite decades of engineering effort…
In short
Mold is a new linker designed to drastically speed up building large software projects by using massive data parallelism across all linking passes. It tackles the bottleneck of traditional link times by parallelizing operations like input parsing, symbol resolution, and string merging. The result is significantly faster linking for multi-gigabyte binaries compared to existing tools.
Key concepts
- Data Parallelism
- This technique involves performing many tasks simultaneously on different pieces of data rather than one after another. Mold applies this by executing entire passes of the linker in parallel, using parallel-for loops within each pass to speed up operations like parsing and merging.
- Order-Sensitive Semantics
- Existing linkers are limited because they rely on a strict left-to-right sequence for operations. This sequential nature makes it difficult to introduce parallelism without rewriting the entire linker, as changing the order of steps can break how dependencies are resolved.
- Cumulative Parallelism
- The speedup in mold comes not from one single optimization but from parallelizing every major step in the linking process. Because no single part dominates the slowdown, speeding up all passes together results in a substantial, cumulative performance gain.
Terminology used across episodes
This episode discusses
The paper
mold: A Massively Parallel Linker · Read on arXiv
University of Tokyo
Transcript
Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.
Tom: We're looking at the paper: "mold: A Massively Parallel Linker".
Jane: Here's the gist of the paper. Linking is a critical step in the software build process that combines compiled object files into a single executable or shared library <ref:2608.23228#pg2> Despite decades of engineering effort, link times remain a significant bottleneck in the edit-compiledebug cycle, particularly for large C++ programs <ref:2608.23228#pg2>.
Tom: mold, a Unix/Linux linker that applies data parallelism systematically across the entire linking pipeline, links multi-gigabyte debug binaries in at most a few seconds, and often in under a second <ref:2608.23228#pg2>.
Jane: Architectural Constraints of Existing Linkers Existing linkers are constrained by order-sensitive semantics and lack formal specifications which makes it hard to change conventions <ref:2608.23228#pg2> Traditional Unix linking is defined in terms of a single left-to-right pass over the command line, and an extracted member may itself introduce new undefined references, so member extraction follows use-def chains across archives that a sequential scan naturally resolves <ref:2608.23228#pg2>.
Tom: Furthermore, pervasive parallelism is hard to retrofit because parallelizing certain passes changes the order in which global decisions are made, and making these changes amounts to rewriting much of the linker all at once <ref:2608.23228#pg2>.
Paper summary: Tom: So we're looking at this paper called "mold: A Massively Parallel Linker," and it tackles something that really slows down building big C++ programs, which is linking. It claims this tool uses data parallelism across the whole process to make multi-gigabyte debug binaries link in a few seconds, sometimes under a second >
Jane: That sounds incredible for developers who have huge projects because those build times used to be a massive bottleneck in the edit compile debug cycle >
Lu: The core idea is that existing linkers are stuck because they handle things like symbol resolution and archive processing in an order-sensitive way, which just limits how much they can use modern CPU cores >
Meng: So you're saying the old way of doing things forces everything into a single thread because the decisions have to be made one after another across the whole linking pipeline >
Lalam: Exactly. Existing linkers are constrained by those order-sensitive semantics, and if you try to add parallelism, it changes how global decisions are made, which means rewriting a huge chunk of the linker >
Tom: The authors show how mold decouples these things so they can apply data parallelism systematically across the entire linking pipeline >
Jane: They break down what existing linkers like GNU ld and lld are doing in terms of parallelization, showing where they're stuck with sequential steps >
Lu: The paper points out specific passes, like input file parsing and symbol resolution, that can be parallelized because they don't depend on the order of everything else yet >
Meng: What I want to know is how this affects deployment; if we move to a system that uses mold instead of lld or GNU ld, does it translate into a real cost reduction at scale >
Tom: The speedup comes from the cumulative effect of parallelizing all passes, meaning no single optimization is doing all the heavy lifting for the performance gain >
Jane: That cumulative effect is what’s interesting because it suggests you can improve performance by attacking every part of the process simultaneously rather than picking one hot spot >
Paper summary: Lalam: The ablation study they run shows that no single optimization dominates; instead, you get speedup from parallelizing all passes together >
Tom: And on large real-world programs, they're seeing results like up to one hundred twelve times faster than the traditional GNU ld linker > <ref:2608.23228#pg1,faster than the traditional GNU ld>
Jane: That comparison against GNU ld is pretty huge because that tool has been around forever and is single-threaded >
Lu: The paper also mentions system-level optimizations, like using huge pages for the output file and block preallocation, which are easy for any linker to adopt >
Meng: Those system tweaks are nice, but how much of the speedup they claim is actually due to those low-level OS tricks versus the core data parallelism in mold >
Tom: The scalability analysis suggests that mold speeds up steadily as you increase the thread count, which confirms it’s about parallel scalability rather than just clever system tweaks >
Jane: So if a developer is building something massive, they might see a significant time saving just by switching to this design concept >
Lu: The paper also discusses how they model section garbage collection using a mark-sweep traversal of a directed graph where sections are vertices and relocations are edges >
Meng: That sounds complex to manage in production; what’s the practical complexity of implementing that kind of graph traversal within a real build system >
Tom: It's modeled as a mark-sweep, which is a standard way to handle those kinds of dependencies when you have parallel work happening across all input files >
Jane: So we see these complex ideas being systematically applied across the entire linking process, from parsing right down to output generation >
Lalam: The paper also notes that string merging is deduplicated by inserting strings into a concurrent hash map in parallel across all input files >
Meng: A concurrent hash map sounds tricky to get right under heavy load; does that introduce new kinds of synchronization bugs or complexity when deploying this at scale >
Paper summary: Tom: It's designed for concurrency, and the goal is to keep those operations running in parallel even when dealing with massive inputs like multi-gigabyte binaries >
Jane: What this really means for a user is that they get a much faster feedback loop when they are iterating on large software projects >
Lu: The authors also talk about how symbols are named entities, and relocations are metadata instructing the linker to patch specific locations in section data to fill in addresses of symbols whose final locations aren't known at compile time >
Meng: So if you're using a shared library, the fact that position-independent code has to be managed differently because of potential address collisions is a real deployment headache >
Tom: That’s why the paper focuses on how mold handles those archive bundles and position-independent code structures better than before >
Jane: It seems like they are really addressing those deep architectural constraints of existing linkers, showing how a clean slate design can overcome that inherent sequential nature >
Lalam: The whole point is that by designing around pervasive parallelism, you get substantial end-to-end speedups because the serial or incompletely parallel work was spread throughout the pipeline >
Tom: So to sum up this paper on "mold: A Massively Parallel Linker," it shows how every major linker pass can be parallelized and that doing so yields substantial end-to-end speedups >
Jane: It suggests that the performance gap between current state-of-the-art linkers and this new design isn't due to one single bottleneck, but because serial or incompletely parallel work appears throughout the entire pipeline >
Lu: The implication is that we need to rethink how we structure these tools from the ground up if we want to keep up with the demands of large C++ programs >
Meng: For someone shipping models, it means less time waiting for builds and more time actually debugging or iterating on features, which is a tangible win >
Tom: The real story here is that when you parallelize everything systematically, the performance gain isn't from one clever trick but from the total effect across all those passes >
Conclusion: Tom: So, this paper is about mold, which is a linker that uses data parallelism to make linking multi-gigabyte debug binaries incredibly fast—sometimes under a second when you're comparing it to older tools like GNU ld or lld.
Jane: It’s interesting because most people think linking is just a slow sequence of steps, but this paper shows how you can apply parallelism across almost every single step of that process systematically.
Lu: The authors are showing how existing linkers get stuck because they have to make decisions in a strict left-to-right order, and mold redesigns the whole thing to run things at the same time where possible.
Meng: From my side, I'm interested in the scalability aspect; if this design holds up across different machine architectures, it could actually matter for how we deploy large AI models that need complex linking processes.
Lalam: I’m seeing a lot of work on string merging and symbol resolution being handled concurrently in parallel maps, which makes sense because those are massive bottlenecks when you have huge input files.
Tom: The main thing they're arguing is that the speedup isn't from one big trick, but from applying parallelism everywhere, which leads to these large end-to-end gains.
Jane: So, if you only listen to this part of the show, you should think about how we can take those old sequential linking tools and rethink them entirely by making every pass parallel.
Tom: Exactly. The implication is that the performance gap between current state-of-the-art linkers and this new design isn't due to one single bottleneck, but because serial or incompletely parallel work appears throughout the entire pipeline.
More episodes
- 2505.16254-Human-AI Writing as Distributed Cognition: Reassessing Collaborative Writing Theories in the Age of LLMs
- 2506.10913-Choreographic Quick Changes: First-Class Location (Set) Polymorphism
- 2507.14812-A Black-Box Approach for Exogenous Replenishment in Online Resource Allocation
- 2507.15448-Frames over finite fields with respect to the Galois inner product and their connections to self-orthogonal and LCD codes
- 2508.21572-NewsReX: An Open-Source Multi-Framework for Neural News Recommendation
- 2509.17028-Impact of Packetization on Network Calculus Analysis
- 2510.17342-AoA Services in 5G Networks: A Framework for Real-World Implementation and Systematic Testing
- 2511.04088-Efficient and rate-optimal list-decoding in the presence of minimal feedback
- 2511.17264-Notes on Stack Machines and Quantum Stack Machines
- 2601.15318-On the closest balanced game