3

What techniques do you use to compile and start VSC++ projects fast?

For us, especially the loading of all the dlls take a long time. Is there a way to speed this up? The project loads a ton of .dlls and some of them are especially slow.

Now that we use unity build for our projects, it already compiles blazingly fast! =)

Thanks!

Tony
  • 417
  • 4
  • 11

2 Answers2

4

DLLs have a default load location embedded into them. This is typically defaulted by the development tool to the same address for all DLLs. This means that whenn the DLLs are loaded into memory, there are a lot of collisions and the DLL has to be readdressed and loaded into a free memory location. When working on a project that had a significant number of DLL dependencies, we were able to make significant load time savings by setting the default address for our DLLs.

A fuller explanation into what's going on and how it helps can be found at drdobbs.

It's been some years since I've done this, so it may be out of date now.

It's worth keeping in mind if you go down this route, it might not play very well with .net.

forsvarir
  • 10,749
  • 6
  • 46
  • 77
  • Does setting the start addresses manually have any effect on address layout randomization? – RedX May 09 '11 at 15:25
  • @RedX: I don't know. As I said, it's been some years since I've done this. Based on some quick reading, I'd guess that if you link to have ASLR enabled, it would ignore the embedded address, but it *is* a guess (I haven't tracked down a source). If you're interested, it may be worth asking te question on here to see if anybody knows. – forsvarir May 09 '11 at 20:40
  • @RedX: All (code) DLLs have their load address set. It's a mandatory field in the PE header. The problem solved with rebasing is that you've got them all set to the same address. ASLR must ignore that field to work at all. Of course, 90% of the benefits of ASLR are gained by randomizing just the system DLL load addresses. – MSalters May 10 '11 at 09:18
2

Use delay-loaded libraries. It's a simple compile settings change (typically no code changes needed), yet it can offer very big improvements.

Of course, you still have the load times of those DLLs when you actually use them, but if you have many DLLs there's also a large chance that you won't use all of them all of the time.

MSalters
  • 173,980
  • 10
  • 155
  • 350