I compiled the master branch with Clang14, but when debugging with LLDB, the startup is too slow. And when I add some comments to the source code, the last
Linking CXX executable programs/clickhouse is also very time consuming.
Have any optimization suggestions?
Compiler name and version
computer hardware configuration
CPU processor: 48
MEM total: 100G+
The common wisdom is that lld is faster LLD - The LLVM Linker — lld 15.0.0git documentation as opposed to ld. (side note that mold exists too GitHub - rui314/mold: mold: A Modern Linker but I’ve not used it myself)
The other thing you could try is split-dwarf where the debug information is in its own file. Reduce binary size and compile time with split DWARF Last time I used it I did so via gcc so I’m not sure if clang supports it. Some reports that it can reduce link time.
For lldb I’d assume most of the startup time is reading symbols. I think the
target.preload-symbols setting might help here. Could be that you still pay the price once you ask for the first symbol though, it’ll depend what you’re doing.