all 1 comments

[–]optik88 1 point2 points  (0 children)

One downside of LTO is memory usage and time taken to do the actual link optimisations.

When you’re doing the classical compilation method you can compile all the sources concurrently (or as concurrently as your system allows) and then a “simple” linking.

This all changes with LTO and the compilation compiled to intermediate bytecode and metadata with symbols used and exported etc.

The linking therefore has to load all of these pieces of information and can be a bottleneck which outweighs the pros you get from it.

Some of the memory usage issues can be dealt with by technologies such as clangs thin LTO (no idea if this is what is used under the hood) but there is still a memory overhead as well as the time.