Solved

Application Performance

Posted on 2006-06-22
8
221 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now