views:

150

answers:

5

Hello,

Apparently the speed of the C++ linker in Visual Studio 2010 hasn't improved that much (about 25% in our case). This means that we're still stuck with linking times between 30 seconds and two minutes. Surely there are linkers out there that perform better? Does anyone have experience with switching to another linker or even a complete tool set and seeing linking times go down drastically?

Cheers,

Sebastiaan

+3  A: 

There may be, but I imagine you'd be talking improvements in the range of a few percentage points. You're unlikely to find anything that's magnitudes faster (which is, I assume, what you'd like).

There are ways to improve your link times, though. What options do you have turned on? Things like "Enable Incremental Linking" and "Enable Function-level Linking" can have dramatic effects on linking performance (well, obviously the first time you link it'll be a "full" link, but subsequent links can be made much quicker with these settings).

Dean Harding
We've turned off all those nasty linker options, we try to link as 'normal' as possible. :) The slowness of the Visual Studio linker is caused by generating the pdb. If we leave out /debug, linking is nice and quick. I'm hoping that there's some linker out there that does the debug info generation in a smarter (parallel) way.
Sebastiaan Megens
@Sebastiaan: Those linker options are not nasty by any standard.
rwong
Turn off Link-time code generation (LTCG) because it is the slowest of the options.
rwong
@rwong: incremental linking IS nasty for big projects. For us 10% of the time it works and link time is decreased by about 75%, 90% of the time it doesn't work and link time is increased by at least 200%.
Sebastiaan Megens
@Sebastiaan: Looks like a bug in VS2010. Please file a bug report with Microsoft Connect. (Disclaimer: I'm not affiliated with Microsoft.)
rwong
+7  A: 

You may well find a faster linker but, unless it's ten times as fast and I'm linking thirty times an hour, I think I'd prefer to use the tools that Microsoft has tested with.

I would rather have relatively slow link times than potentially unstable software.

And you kids are spoilt nowadays. In my day, we had to submit our 80-column cards to the computer centre and, if we were lucky, the operator would get it typed in by next Thursday and we could start debugging from the hardcopy output :-)

paxdiablo
I'm glad things evolved since then ! ;)
ereOn
+3  A: 

When we checked the linker speed, we have identified the disk speed to be the most limiting factor. The amount of file traffic is huge, especially because of debugging info (just check the size of the pdb).

For us the solution was:

  • install insane amounts of RAM, so that a lot of file traffic can be cached (go for 4 GB, or even more, if you are on 64b OS). Note: you may need to change some system settings so that system is able to dedicate more memory for the cache
  • use very fast hard drive (connecting multiple of them as RAID may help even more)

We have also experimented with SSD, but the SSD we have tried had very slow write performance, therefore the net effect was negative. This might have changed meanwhile, especially with the best of SSDs.

As a first step I would suggest to launch Process Explorer (or even Task Manager will do) and check your CPU load and I/O traffic during the link phase, so that you can verify of you are CPU limited, or I/O limited.

Suma
Did you try RAM disks on machines with sufficient RAM?
Georg Fritzsche
No, we did not. I expect proper caching should have almost the same effect (write are done in background anyway), but I may be easily wrong.Once we have upgraded the HW (fast HDD + large RAM), the issue was no longer important for us and we had no motivation to experiment with any more improvements.
Suma
+1  A: 

Check out "Unity" builds. This improves link times dramatically:

http://stackoverflow.com/questions/847974/c-the-benefits-disadvantages-of-unity-builds

Jim
Thanks for the tip, but we're already doing that. Before we did, link times were between five and ten minutes.
Sebastiaan Megens
+2  A: 

Wow and i get nervous when my link time is above 10 sec.

Use modern style SSD Disks. I have 2x 60 GB OCZ Vertex2 E Disks as a RAID 0 and IO is not a problem anymore. SSD are now good enough for daily use even for heavy writes.

And get a few gigabyte of memory. Can't see any reason anymore to work with less then 8 GB RAM.

Lothar