?
Solved

Application Performance

Posted on 2006-06-22
8
Medium Priority
?
235 Views
Last Modified: 2013-11-20
I have several applications that reside on a server that are run by multiple users.  Do to recent networking changes the applications are taking much longer to start (15 seconds vs 3 seconds).    A big part of the problem is that we link in several very large static libraries which makes the exe several MB.  Would linking the libraries as DLLs help the performance significantly?  What other suggestions would you have for improving the startup time?

Thanks,

Joe
0
Comment
Question by:jribble
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 16962868
Is it possible that when application starts, it tries to find Dll in some network directory? This can take a lot of time, especially if required server is not connected. I would check system PATH variable.
Maybe some program initialization code tries to make some connection.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16963059
<A big part of the problem is that we link in several very large static libraries which makes the exe several MB>

With the disk (and cache) performance I can hardly believe that would make much of a difference, especially as you experience such a drop in performance after network changes.

Having a drive mapping (rather than UNC) *may* help.
0
 

Author Comment

by:jribble
ID: 16963725
When I run the same application off my local (C:) drive, it starts in less than 3 seconds (using the same path).  When I copy a file from our network drive to my local drive, it takes relatively long time - so I am fairly certain is has to do with the time is takes to load the executable.  I'm guess it has to load the executable each time it is run - correct?  Do DLLs work the same way?  Or are they saved in the computer's memory so that they don't have to be loaded each time?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:AlexFM
ID: 16966359
Do you mean that you start application from other computer? In this case test how many time takes to Windows Explorer to copy exe and all Dll files from network to local drive - this is executable loading time.
When application starts from local drive, OS tries to use existing memory cache when it is possible, usually second time application starts faster. I don't know whether this is done for application from network drive.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16966594
exe vs dll.
If your exe calls a function in a dll (eg during startup) then the dll also needs to be loaded into memory.  (loading 2MB exe vs loading 1MB exe and 1MB dll - hmmm).
Using dlls will be an advantage if you use LoadLibrary and GetProcAdress for functions - then a dll only needs to be loaded when required.
0
 

Author Comment

by:jribble
ID: 16968495
One thing I may have failed to mention is that this application gets lauched many times during a given day - we have another application that acts as a launchpad (maybe this wasn't the best design).  Anyway, in that case, would DLLs provide any advantage?
0
 
LVL 14

Accepted Solution

by:
wayside earned 2000 total points
ID: 16972305
Generally, static linking makes the program load much faster, because a lot of time is spent resolving the addresses of the imported functions, which you don't have to do if the image is statically linked.

If the dll's are local, that might save time because they won't have to be pulled over the network. If the dll's are on the same network machine as the exe, you won't gain anything by using dll's, and it will likely get slower, because the statically linked image will be smaller in size than the dynamically linked image + dll's, plus the extra time to resolve the addresses.

> Or are they saved in the computer's memory so that they don't have to be loaded each time?

When the program exits, the dll's are unloaded unless they are in use by another program. You could maybe try keeping a stub program running all the time that keeps the dll's loaded, but that seems awfully kludgey to me.

I think your best bet is to fix your networking.

If you can't do that, another possibility is to investigate using a PE executable compressor, these can often reduce the size of your exe by 60-70%. With that much less to pull over the network, it might significantly increase the startup time.

Another option is to never exit the program; if the user closes all the windows, don't exit, and have the lauchpad app send it a message to reopen its windows. That way you only take the startup hit once.
0
 

Author Comment

by:jribble
ID: 16992722
I downloaded a PE executable compressor (PECompact2) and was able to reduce my executable size by nearly 90%.  This improved startup time significantly!  Thanks for the tip.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question