Recently, my boss asked me to improve the launch speed of our application, the AP was written with C++. The AP is a little big, it used 200+ dll, Windows needs long time to enter the main() function. I tried these two ways, but still can't make our boss happy.
Are there other ways to improve it? Thanks in advance.
You need to profile your application in order to determine the true cause of the slowdown. For example, it could be that you are spending most of the time in some initialization routine of one the .dll's you are loading. Go find yourself a good profiling tool and then determine where the bottleneck is.
Jeez! Reduce that DLL count!
Of course, if you're gonna load 200 DLLs on startup, it's gonna incur heaps of hard page faults, and take forever to boot (like 3ds max).
Rethink your DLL strategy. Combine many small DLLs into larger ones. I seriously doubt you need 200+.
And watch Raymond Chen's Five Things Every Win32 Programmer Needs to Know.
A couple of things I guess you need to know:
Reducing the amount of DLLs is a must in this situation. Maybe you can combine then, but I guess it's a modular design, which means, most of the times, they cannot be combined.
You could also load the DLLs on use, instead of on opening of the program and only load the necessary DLLs to load the program on startup.
Or you could even delay the loading of DLLs by first starting the program with the necessary DLLs and then load the others, on order of importance to use.
If you have access to the code of the dlls ( or some of them ) you could look for candiates to staticly link. If you can convert a bunch of them to static libraries, you could speed up the startup dramaticaly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With