3

I am aware that there are a couple of questions that look similar to mine, e.g. here, here, here or here. Yet none of these really answer my question. Here it goes.

I am building a modified version of a Chromium browser in VS2008 (mostly written in C++). It has 500 projects in one solution with plenty of dependencies between them. There are generally two problems:

  • Whenever I start debugging (press F5 or green Play button) for the first time in a session the VS freezes and it takes a couple of minutes before it recovers and actually starts debugging. Note that I have disabled building before running, because whenever I want to build my project I use F7 explicitly. I do not understand why it takes so long to "just" start a compiled binary. Probably VS is checking all the deps and making sure everything up-to-date despite my request not to build a solution before running. Is the a way speed this one up?
  • Every time I perform a build it takes about 5-7 minutes even if I have only changed one instruction in one file. Most of the time is consumed by the linking process, since most projects generate static libs that are then linked into one huge dll. Apparently incremental linking only works in about 10% of the cases and still takes considerably long. What can I do to speed it up?

Here is some info about my software and hardware:

  • MacBook Pro (Mid-2010)
  • 8 GB RAM
  • dual-core Intel i7 CPU with HT (which makes it look like 4-core in Task Manager)
  • 500GB Serial ATA; 5400 rpm (Hitachi HTS725050A9A362)
  • Windows 7 Professional 64-bit
  • Visual Assist X (with disabled code coloring)

Here are some things that I have noticed:

  • Linking only uses one core
  • When running solution for the second time in one session it is much quicker (under 2-3 seconds)
Community
  • 1
  • 1
Sergiy Belozorov
  • 5,856
  • 7
  • 40
  • 73
  • The most time taken in such operations is certainly disk access. When you do it a second time, everything is already cached. – wormsparty Oct 21 '11 at 12:18
  • Hmm... this makes me think that there is no way I can accelerate it even with RAM disk, since it will take time to load it from disk anyways. – Sergiy Belozorov Oct 21 '11 at 13:00

2 Answers2

1

while looking up information on VS linker I came across this page:

http://msdn.microsoft.com/en-us/library/whs4y2dc%28v=vs.80%29.aspx

Also take a look the two additional topics on that page:

  • Faster Builds and Smaller Header Files
  • Excluding Files When Dependency Checking
olegvs
  • 345
  • 3
  • 11
  • Thanks for info. Very interesting indeed, but unfortunately doesn't solve my problem. It is all about compilation, while I am experiencing delays with linking and starting the executable. – Sergiy Belozorov Nov 13 '11 at 23:03
0

I have switched to the component build mode for Chromium project, which reduced the number of files that need to be linked. Component build mode creates a set of smaller DLLs rather than a set of static libraries that are then linked into huge chrome.dll. Also I am using incremental linking a lot, which makes linking even faster. Finally linking for the second and subsequent times gets faster since necessary files are already cached in the memory and disk access is unnecessary. Thus when working incrementally and linking often, I get to as low as 15 seconds for linking of webkit.dll which is where I mostly change the code.

As for the execution it has same behavior as linking - it runs slow only for the first time and with every subsequent run it gets faster and faster until it takes less than 3-5 seconds to start the browser and load all symbols. Windows is caching files that are accessed most often into the memory.

Sergiy Belozorov
  • 5,856
  • 7
  • 40
  • 73