Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Application Performance

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
jribble
Asked:
jribble
  • 3
  • 2
  • 2
  • +1
1 Solution
 
AlexFMCommented:
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
 
AndyAinscowFreelance programmer / ConsultantCommented:
<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
 
jribbleAuthor Commented:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
AlexFMCommented:
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
 
AndyAinscowFreelance programmer / ConsultantCommented:
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
 
jribbleAuthor Commented:
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
 
waysideCommented:
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
 
jribbleAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now