HeroOfSpielburg

Hello,

This is more of a theory question, than a complaint. Recently my project has been growing more and more complex due to an infusion of new technolgies, and along the line two considerable growing pains have been ballooning: link and application start-up times.

I suppose this is inevitable, but it bothers me that I don't know exactly why these phenomena are occuring. If anyone can provide some insight as to concretely what factors most directly lead to this kind of performance, in terms of the linker and module loader, I would be very grateful.

Essentially, the things that have been changing are:

* a dramatic increase in project dependencies (from 4-6 to the order of 20-30)
* usage of RTTI
* usage of multiple inheritance, and a deep class hierarchy
* movement from unmanaged C++ to a mixture of languages including unmanaged C++, C++/CLI, C#, and lua

Generation of the manifest itself frequently takes several minutes, and on load there is at least a minute wait while "'App.exe': Loaded 'C:\WINDOWS\XXXXXXXX', No symbols loaded." messages slowly trickle in through the Output window, XXXXXXXX being one file from a very long series of DLLs in either system32 or WinSxS.

While the development wait time is an incredible pain that can be tolerated, ultimately something will have to be done about the start-up time of the application. Is this a DLL versus static link tradeoff

Thank you for any information you can provide,



Re: Visual C++ General What factors go into link and start-up time?

Bruno van Dooren

With startup times, you should only look at release builds, not debug builds.

For debug builds the startup times can be huge because a large amount of debug code is loaded and jitted at startup.

If release builds are still slow, you can use ngen to pre-jit the assemblies so that the jitting is already done when you start the application.

For link times, everything you mention will increase build times.

increased dependencies will trigger rebuilds of all the projects that depend on a changed project.

RTTI will make things slower.

Mixed mode builds of C++ apps take longer, and if I remember correctly, incremental linking is disabled for mixed mode C++ projects.

In your case, focus on the startup time of the release build of your product, and try ngen.





Re: Visual C++ General What factors go into link and start-up time?

Simple Samples

If you are using static libraries instead of DLLs when DLLs are available then that is a likely cause, but I don't have much experience to be sure. I know that Microsoft suggests strongly to avoid use of their static libraries if possible. Another disadvantage that Microsoft emphasizes is that when an executable is built using static libraries the libraries are not updated unless you relink. That is not much of a disadvantage for debug builds but a potential major problem for release builds. For debug builds there is seldom or never a need to use static libraries.

The no symbols loaded messages are normal information messages.

For debug builds, are you using incremental linking For compiling, there is an equivalent option; something about compiling only functions that have changed.