4 ms·
> How many businesses are so constrained by link times on Mac […] Long link times are not specific to OS X / iOS. Large C++ codebases are some of the worst off
by inkyoto 4y ago
> How many businesses are so constrained by link times on Mac […]
Long link times are not specific to OS X / iOS. Large C++ codebases are some of the worst offenders and emit obscene numbers of relocations and DWARF symbols (or similar) into object files that bog linkers down. KDE, Firefox and Chrome browsers instantly come to mind. Rust and GHC generated object files also take a whiiiiiiiile to link[0].
On the businesses being constrainted by the link times subject more specifically. Über posted an article a while back enunciating the shenanigans they have to go through to build their iOS app (the app download at some point measured in a 300Mb+ vicinity): https://www.uber.com/en-GB/blog/how-uber-deals-with-large-ios-app-size/ https://www.uber.com/en-GB/blog/how-uber-deals-with-large-io... . From the «Build Times» section of the blog post:
> The default pipeline builds the app in 21 minutes; the new pipeline with no machine outlining takes 53 minutes, which includes about 7 minutes of llvm-link, 14 minutes opt, 11 minutes of llc and 3 minutes of the system linker. One round of outlining takes about 7 minutes in llc, and 2 rounds take 9 minutes. Each additional round adds progressively less extra time, usually under 30 seconds. Overall, 5 rounds of outlining builds in 66 minutes — a 45-minutes addition to the baseline.
So, a default CI/CD build with no outlining heuristics applied spends 10 mins (7 + 3) out of a total of 53 mins in the linker. That is for a single CI/CD run.
And, since at least company has funded the work on fixing relocatable file generation in mold, there is indeed at least some demand:
> GHC (Glasgow Haskell Compiler) in particular uses re-linkable object files as dynamic libraries instead of real .so files, and it didn't work with mold. Now, mold can produce object files that GHC can load. Note that this work was funded by Mercury, so thanks to the company to help us improve the product.
[0] Fun fact: I have measured the memory throughput at the GHC linking time (via LLVM lld); it averages 65Gb/sec, and it can occasionally shoot over 70Gb/sec. So a faster linker still matters.