Solved

Application Performance

Posted on 2006-06-22
8
229 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 44

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 44

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 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 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