[lld] [lld][MachO]Multi-threaded i/o. Twice as fast linking a large project. (PR #147134)

John Holdsworth via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 10:02:17 PDT 2025


johnno1962 wrote:

Some more timing data. Up till now I've been benchmarking linking on an external SSD where the baseline (cold link, without using the new --read-threads=20 option) is about 25-26 seconds, using the option, 12-13, re-linking immediately a second time 7 seconds and the new option makes no difference. You only need to wait 15 second between links for the external drive data to be flushed from the disk cache and the linking time to revert to 12-13 seconds with the option.

Recently, I moved the entire chrome build directory onto my local drive and for linking the baseline times are now 19 seconds, cold link, 11 seconds with --read-threads=20 and 6 seconds with a "warm" link where the data is already in memory (my Mac has 64GB). Oddly, the amount of time for the machine to forget this data it has just loaded is different on the local drive and you can perform a subsequent link minutes later and still get the "warm" link time of 6 seconds unless you perform some other heavy task e.g. compiling or foregrounding Xcode which pushes the disk pages out of memory. I guess this explains how this issue has remained under the radar all this time.

https://github.com/llvm/llvm-project/pull/147134


More information about the llvm-commits mailing list