michaeleisel / zld

A faster version of Apple's linker
MIT License
1.19k stars 50 forks source link

Large Binary Instruments Profile Data #38

Closed milend closed 4 years ago

milend commented 4 years ago

I've recorded profiling data (zld.trace.zip) for a large binary which takes several minutes to link. In terms of numbers:

zld is around 1min faster (~23% faster). Machine was rebooted before taking the measurements and the samples taken with hot file caches (i.e., linkers ran before recording the samples above). Machine is a 15" MacBook Pro 2017, i7 3.1GHz, 16GB RAM and 1TB SSD.

michaeleisel commented 4 years ago

Thank you!

milend commented 4 years ago

@michaeleisel: here's another trace of linking the same exact binary without passing an order file. This cuts the linking time from around 3m15s to 56s (outside Instruments). There's still a large section which is single-threaded, so I'm wondering if it can be parallelised – it would result in a huge perf win.

zld-no-order.trace.zip

tcpthecode commented 4 years ago

@milend how did you pass order file into linker ? In my case, the binary layout is just the same after defined order file for linking 🤔

milend commented 4 years ago

@tcpthecode We use the -order_file parameter.

tcpthecode commented 4 years ago

Thanks @michaeleisel 👍