1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-10 19:26:38 +03:00

temporary

This commit is contained in:
Rui Ueyama 2021-01-16 17:27:06 +09:00
parent 226a8f1c59
commit 43258748b9

View File

@ -2,13 +2,13 @@
![mold image](mold.jpg)
This is a repository of a linker I'm currently developing as an
independent project for my Masters degree.
This is a repository of a linker I'm currently developing as a
replacement for existing Unix linkers such as GNU BFD, GNU gold or
LLVM lld.
My goal is to make a linker that is as fast as concatenating input
My goal was to make a linker that is as fast as concatenating input
object files with `cat` command. It may sound like an impossible goal,
but I believe it's not entirely impossible because of the following
two reasons:
but it's not entirely impossible because of the following two reasons:
1. `cat` is a simple single-threaded program which isn't the fastest
one as a file copy command. My linker can use multiple threads to
@ -18,20 +18,22 @@ two reasons:
available during file copy. We can use them to do extra work while
copying file contents.
Concretely speaking, I want to use the linker to link a Chromium
executable (~1.8 GiB in size) just in 1 second. LLVM's lld, the
fastest open-source linker which I originally created a few years ago,
takes about 12 seconds to link Chromium on my machine. So the goal is
12x performance bump over lld. Compared to GNU gold, it's more than
50x.
Concretely speaking, I wanted to use the linker to link a Chromium
executable with full debug info (~2 GiB in size) just in 1 second.
LLVM's lld, the fastest open-source linker which I originally created
a few years ago, takes about 12 seconds to link Chromium on my machine.
So the goal is 12x performance bump over lld. Compared to GNU gold,
it's more than 50x.
I don't know if I can ever achieve that, but it's worth a try. I need
to create something anyway to earn units to graduate, and I want to
(at least try to) create something useful.
It looks like mold has achieved the goal. It can link Chromium in 2
seconds with 8-cores/16-threads, and if I enable the preloading
feature (I'll explain it later), the latency of the linker for an
interactive use is less than 900 milliseconds. It is actualy faster
than `cat`.
I have quite a few new ideas as to how to achieve that speedup, though
they are still just random unproved thoughts which need to be
implemented and tested with benchmarks. Here is a brain dump:
Note that even though mold can create a runnable Chrome executable,
it is far from complete and not usable for production. mold is still
just a toy linker, and this is still just my pet project.
## Background