News for hackers. Stuff that matters.
Re:Inside the Linker (2012) by ma2rten on Friday July 13, 2018 @01:42AM (#17520752)
I work on C++ code at a large tech company. My workflow is such that I compile and run tests often after I made incremental changes. I feel like I often wait for the linker for ages.

I am wondering if linking could be sped up. I feel like a lot of the steps mentioned here could be cached for instance.

Re:Inside the Linker (2012) by jstimpfle on Friday July 13, 2018 @05:42AM (#17521619)
I, too, have been wondering that. On a high level, a linker does these things:

- Read in objects file and parse linking information (needed symbols etc)

- Do some in-memory calculations - resolving symbols and some other stuff. Simple graph theory. Is there any need for more than O(n log n) runtime?.

- Write out object files

I don't think anything should take so long. No caching needed. I read the series on linkers by gold's author, where significant speedups were claimed. And also, that object-oriented C++ was the right approach to software architecture. I strongly disagree with that second point and didn't understand too much from the article series to be honest. So I am not surprised at all that there are today even much faster linkers.

Re:Inside the Linker (2012) by johncolanduoni on Friday July 13, 2018 @04:17AM (#17521306)
I've seen (sometimes drastic) performance improvements when switching to LLVM's new linker lld[1]. It works quite well on both Linux and Windows in my experience.

[1]: https://lld.llvm.org/

Re:Inside the Linker (2012) by int0x80 on Friday July 13, 2018 @02:26AM (#17520901)
If it does LTO it gets worse. Maybe you can disable it for dev, if its enabled?
Re:Inside the Linker (2012) by mehrdadn on Friday July 13, 2018 @02:47AM (#17520969)
Can/do you have incremental linking enabled?