4

Have you ever experienced a slow linking process in a C++ project compile (I'm using VS2013)? I get linking process taking 15 minutes after a 5 minutes Build. A Rebuild or Visual Studio restart does not fix the issue. Task manager shows mspdbsrv.exe taking a full core (25% on a 4-core), and pdb file creation is very slow, Kb after Kb it reaches 50 Mb. Additional info:

  • the same project on another computer build and link in acceptable time.
  • antivirus is disabled
  • I've tried changing the pdb file creation location: no success
  • I've set the linker output Verbose, but it stops at one debug row and then wait all the time there.
  • VS2013 is updated to SP4
  • Hard disk activity led on my laptop is mostly turned off, so there's no full activity on the disk.
  • I'm running Windows 7 Pro.
  • VS2013 is run with administrator rights

Thank you.

ABCplus
  • 3,981
  • 3
  • 27
  • 43
  • 2
    Mspdbsrv.exe burning 100% core is the problem of course. Pretty hard to come up with a reason, it has been stable for quite a while. Use a debugger to have a look-see, start another instance of VS and use Tools + Attach to Process to attach to the process while it is slaving away. Look for something like excessive amounts of exceptions, look at stack traces when you repeatedly use Debug + Break All to have a guess where it might be hung up. *Something* to show us. Calling Microsoft Support is strongly indicated, they'll ask you to record ETW traces and send it to them. – Hans Passant Sep 18 '14 at 12:56
  • Did you try running VS2013 as an administrator? – egur Sep 23 '14 at 12:21
  • Yes, done. I'll add to the list above – ABCplus Sep 23 '14 at 15:12
  • @HansPassant: using "Attach to Process" feature and then hitting Break All is somewhere in the library C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\mspdbcore.dll. – ABCplus Sep 23 '14 at 15:18
  • Well, I could have guessed that. If you don't show us a stack trace, one you see repeat well, then it is still of no use. – Hans Passant Sep 23 '14 at 15:26
  • 1
    Please check parallel compilation setting under "Active configuration->C/C++->General->Multiprocess compilation, it's off by default in VS2013. It also may required to change Code generation->Enable minimal rebuild to No. – Danila Polevshchikov Sep 25 '14 at 08:26
  • @DanilaPolevshikov: I did it, but with no success... – ABCplus Sep 25 '14 at 09:33

2 Answers2

5

Fixed changing "Debug Information Format" from /ZI (Edit and Continue feature) to /Zi. I still have no clue why this cause a slow linking only on a specific computer and not for the others. Hope this could help people coming here for the same issue.

ABCplus
  • 3,981
  • 3
  • 27
  • 43
4

Is it using Link-Time Code Generation? On VS2010 that step was single threaded so it takes much longer than the apparent compile step. On later versions this step was improved to be multithreaded, according to blog posts. It also mentioned that PDB access is a bottleneck. So, maybe you have an old mspdbsrv.exe on that system? Look at the version info on the file, compared across machines. There might also be some option to control its locking and multi-use behavior, hidden away someplace.

JDługosz
  • 5,592
  • 3
  • 24
  • 45
  • Using Task Manager, looking at the process path location, it points to C:\Program Files\Microsoft Visual Studio 12.0\VC\bin so it's using the VS2013 executable – ABCplus Sep 18 '14 at 07:36
  • Maybe you can find the blog posts about improvements to link times via threading, LTCG, PDB access, etc. and hit up the authors of those posts and ask why it acts like old VS10 for you. – JDługosz Sep 18 '14 at 17:23