Solved

? how can I make an EXE load faster ?

Posted on 2011-09-19
42
553 Views
Last Modified: 2012-08-13
Greetings!

I have an exe that plays keystrokes into a web application.

The exe takes nearly as long to load as it does to run.

Since one goal is to help speed up data entry,
how can I improve the load speed of the EXE?

Is there a way to have it stay resident once loaded?
thanks
Phil
0
Comment
Question by:philkryder
  • 17
  • 7
  • 3
  • +8
42 Comments
 
LVL 23

Expert Comment

by:DanCh99
ID: 36562408
you can set the processor priority to be higher for the process that you're running - Real Time is the fastest:
http://techblissonline.com/run-program-process-cpu-priority-windows-vista-xp/

but that may not resolve your issue.  

But you may need to examine why it's slow in the first place.  Process Monitor is the tool for this:
http://technet.microsoft.com/en-us/sysinternals/bb896645
and a how-to:
http://blogs.technet.com/b/askperf/archive/2007/06/01/troubleshooting-with-process-monitor.aspx
0
 
LVL 1

Author Comment

by:philkryder
ID: 36562735
anything on pre-fetching the exe and having it remain resident for the life of the windows session?
0
 
LVL 23

Expert Comment

by:DanCh99
ID: 36566081
what app are you using, and for what purpose?

It seems that this is a simple task, and would not take a lot of processor time on a modern machine??
0
 
LVL 1

Author Comment

by:philkryder
ID: 36575136
it's an exe that I wrote using Automation Anywhere to step thru web pages and paste data.
It is about 2meg.

0
 
LVL 1

Author Comment

by:philkryder
ID: 36575147

>>DanCh99:
what app are you using, and for what purpose?

It seems that this is a simple task, and would not take a lot of processor time on a modern machine??<<

I don't think it does use a lot of processor - but, it does take time to load.
0
 
LVL 1

Author Comment

by:philkryder
ID: 36590847

moderators - am I in the wrong zone? any help ?
0
 
LVL 1

Author Comment

by:philkryder
ID: 36601672
any help?
0
 
LVL 1

Author Comment

by:philkryder
ID: 36707799
moderator - is this in the wrong section?
0
 
LVL 23

Expert Comment

by:ComputerTechie
ID: 36818714
0
 
LVL 28

Expert Comment

by:Bill Bach
ID: 36818762
I agree that the Process Monitor tool is the best place to start.  This will tell you what the tool is doing at every instant, from Registry access to disk access to spawning threads, and more.  My guess is that there is some sort of dependency on another process (such as Java) that takes a while to launch.  A 2MB file, especially one coming from a local hard disk, is simply not big enough to be slow.  

If you are trying to load the EXE over a network, then this could be indicative of network problems.  The easy test there is to copy it locally and run it from there.  If it loads fast now, then the issue is the network itself.  Again, though, Process Monitor will give you "eyes" into the process to see what it is doing and what is holding it up.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36819153
1. What browser are you using?
2. Do you close all the browser windows after your unit of work?
3. You need to measure the opening of browser windows and the time it takes to load those pages.
4. Create an AA application that does does nothing.  Time its execution several times.
5. Create an AA application that only opens a browser window.  Time its execution several times.

Once you have some performance data from the step4 and step 5 activity, you can start to identify the suspects contributing to poor performance.

Unless you've already written that $2500 check, you might want to consider other automation options.
http://sikuli.org
http://www.autoitscript.com/site/autoit

Also, you might want to read some of the excellent browser-related articles by Dan Rollins:
http:/A_1132-Browser-Bot-Automate-Browsing-Sequences-With-C-PART-ONE.html
0
 
LVL 57

Expert Comment

by:giltjr
ID: 36832868
How long does it take to load?
0
 
LVL 69

Expert Comment

by:Merete
ID: 36838141
Have you added this .exe to the  exceptions list in the antivirus and firewall?
0
 
LVL 1

Author Comment

by:philkryder
ID: 36857791
thanks -

some answers
yes, the exe is masked in the anti-virus and firewall as an exception.

it takes about 5 seconds to load.
by comparison, my HTA that fires the exe load virtually instantly - this is a twin engine pentium

the web pages are already loaded - this AA exe only presses TAB and ENTER  but they are AFTER it loads.

the exe loads locally.
the HTA that loads it via the shell,
checks to see if the correct version of the exe is in WINDOWS/TEMP and loads it from there.

- so process monitor ? --

0
 
LVL 45

Expert Comment

by:aikimark
ID: 36863129
how are you measuring the 5 second load time?
0
 
LVL 21

Expert Comment

by:developmentguru
ID: 36864413
If something like loading JAVA is what is causing the delay then you should be able to test.  If you run it the first time and you see the delay, try running it a second time.  If there is no delay the second time then you will know that whatever was causing the delay is past.  If it is JAVA then you should be able to look up a way to have JAVA load when the system boots.  This will simply move the 5 seconds from program launch to OS load.  It could provide a slight improvement in the user experience though.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 36890152
Why are you having the HTA load an EXE to play a few keystrokes?  Why not use the Sendkeys function of the Shell object?
var oShell = WScript.CreateObject("WScript.Shell");
oShell.AppActivate("Paint"); // Set focus to a program
// WScript.Sleep(500);          // Delay for 1/2 second
oShell.SendKeys("{TAB}");
oShell.SendKeys("{ENTER}");  // Send Enter key (also tilde {~} )

Open in new window


See
Using SendKeys to Automate Repetitive Tasks
http://www.experts-exchange.com/A_2449.html
0
 
LVL 1

Author Comment

by:philkryder
ID: 36892645

load time is measured by timestamp in HTA before and timestamp in the EXE to an external file.

send keys wont wait reliably for window navigation.

nor scrape and populate other fields as easily - I may have to go their but, It looks like process monitor is my friend.
0
 
LVL 16

Expert Comment

by:hjgode
ID: 36915272
Hello

I assume Automation Anywhere does create very complex exe files that load a lot of unneeded stuff for your purpose.

I use the freeware AutoHotKey (AHK) to automate tasks and send keystrokes. Then I simply press the "hot key" and AutoHotKey will do the rest. AHK is loaded once during computer startup and sits in the taskbar.

See http://www.autohotkey.com/

But, possibly keystroke automation is not the only thing required by your solution. But, you did not add much more information except that you need to send TAB and ENTER to a web site inside a browser window. Now, you also stated that the solution has to wait for page navigation in the web browser.
Possibly you can describe your environment and need a bit more detailed.

An exe file takes the time to load the exe file needs to find and initialize all references. The more complex these references are, the more time is needed. Especially the load of OLE and COM objects may take a long time. The load time can mostly improved by reducing external references and to minimize the use of external dependencies. As you dont have any options during the creation of the AutomateAnywhere, you will probably not success in making the exe load faster.

~josef
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 32

Expert Comment

by:sarabande
ID: 36915339
you could try to make a dll out of your exe and a tiny app that calls the dll. unlike to an exe a dll once loaded is not likely to get removed immediately from memory and you could force that by starting a second instance of your app. also there are ways to permantly install/hold a dll loaded which you could take when your assumption that the problem is due to loading times of the exe turns out to be correct. i have doubts about it and would think that the executable needs too much other dlls to load what makes it slow. see also comment of hjgode.

Sara
0
 
LVL 21

Expert Comment

by:developmentguru
ID: 36917433
 If moving code into DLLs is something you think might help then the core functionality should be placed in a service (not DLLs).  A service loads before the user logs in and stays for the run of the OS.

  You may also want to see how much of loading your program is DATA that is compiled into the EXE.  If this data can be removed, or reduced, then the program will load faster.  In some cases you could switch to a higher compression for your pictures and see a dramatic decrease in size.
0
 
LVL 1

Author Comment

by:philkryder
ID: 36918862

the exe seems to take about the same time to load whether it is one or two lines or many.
I'm inferring that AA has to do a considerable amount of work to unpack and modify the EXE before running it.

Mods - please close. thanks. Phil
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36918919
Such programs interpret the control statements (whether source or p-code), so they include code that will do that.  AA is a very sophisticated application and includes many features that aren't provided in lighter weight automation tools.  If you don't need all those AA features, you might experiment with one of the alternatives (maybe Kixtart) and see if you get better load times.  If you do, then the performance bottleneck is somewhere in AA.
0
 
LVL 1

Author Comment

by:philkryder
ID: 36945941
mods - please delete no points.
0
 
LVL 1

Author Comment

by:philkryder
ID: 37029347
I've requested that this question be deleted for the following reason:

no answer met my needs
0
 
LVL 32

Expert Comment

by:sarabande
ID: 37029348
there are a lot of good and right answers here in that thread and many where was rightly guessed that the loading of the author's executable was not responsible for the low performance.

i don't think it is a valid reason for deletion that none of the answers was that what the author had expected.

Sara
0
 
LVL 45

Expert Comment

by:aikimark
ID: 37030701
@Phil

There were several work-around suggestions made in this thread.  Did you explore those?
0
 
LVL 1

Author Comment

by:philkryder
ID: 37031720
none suggest how to make the AA exe load faster.

I don't have the option to make DLLs or run services.

I need the EXE to load faster.

which one do you suggest might show how to do that?
0
 
LVL 28

Accepted Solution

by:
Bill Bach earned 500 total points
ID: 37031758
What about creating a RAMDisk and using that to store the EXE and any related DLL's and data files?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 37031824
@Phil

* I had suggested Auto-It or Sikuli back on 9/29
http:#36819153

* We never discussed where the AA application was loading from, which could be a bottleneck.

* We never discussed what version of AA you are using and whether the version is licensed or a demo/trial version.

* We didn't discuss the performance monitoring results you got.

* There was some question (for me) by earlier comments whether there was a performance lag between the program invocation and the first action or whether there might be some lag in the performance of AA once it got going.

* We never saw a script to determine if there was some other reason for the delay.
0
 
LVL 32

Expert Comment

by:sarabande
ID: 37032648
Phil, your comment 'the exe seems to take about the same time to load whether it is one or two lines or many' tells very clearly that the loading of the exe file is not the reason for the bad performance.

you may choose which answer lets you test the performance with a minimal executable file and find out that the execution time was the same. i wouldn't object if you choose your own answer. but deletion should not be an option to a question which in my opinion was answered, even if you don't like the answer.

i also wouldn't object if you add a new sub question how to improve total performance. i think there are some valid suggestions already in the thread which were worth to be tried.

Sara
0
 
LVL 1

Author Comment

by:philkryder
ID: 37035783

Feel free to object -
but
the question was
?how can I make an EXE load faster?

?which specific answer tells me how to get it to load faster?

Some offered alternatives.
Some offered explanations.

None, that I see gave me a useful way to improve the load speed.
If there had been one,
I would have used it.

Please delete.
thanks
Phil

0
 
LVL 45

Expert Comment

by:aikimark
ID: 37035904
@Phil

Actually, BillBach just posted one (RAM disk).  You might also consider SSD or hybrid disk drive.

>>?how can I make an EXE load faster?
depends on what you are measuring.
depends on which knobs you can turn.
depends on your system configuration and run-time environment.

With EE questions, context is king.  For instance, once the AA program loads, how is its performance?  What is the ratio of program loads to number of items that are automated?  Maybe the problem is that you are only doing one unit of work with each load, rather than doing multiple things with a single load, thus reducing the load's component percentage.

============
You do realize that we depend on you to provide the sensory feed, don't you?  I haven't seen anything that breaks down the process, so that we can isolate the bottlenecks.  You are welcome to request the question be closed.  But be aware that any related questions about AA performance should include enough information for those experts to help you.
0
 
LVL 1

Author Comment

by:philkryder
ID: 37038045
right - that RAM drive is potentially a good one
- it just won't work for me -
I"d have to install and configure it on over 100 machines.

Note also that it came in AFTER I asked to have this closed.
If you feel it is acceptable, then give the points to BillBach?

as for your other comments,
the question was simple because that was what I wanted.

the AA runs "ok" -
but,
there is a delay upon loading.

I don't have the options to do more in each invocation than I am.

that is why the question is/was so straightforward. load an exe faster.

0
 
LVL 1

Author Comment

by:philkryder
ID: 37038062
sarabande:
Phil, your comment 'the exe seems to take about the same time to load whether it is one or two lines or many' tells very clearly that the loading of the exe file is not the reason for the bad performance.

all though you DID infer that.
I don't think there is evidence to support it.

I have time stamps before and after loading.

the vendor indicates that a large amount of work is done while loading the exe.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 37038436
@philkryder

It doesn't matter when a comment was posted.  The BillBach comment is worthy of acceptance, even though you can't implement it in your run-time environment.

==============
This question is a prime example of a "How do I" question that should have been a "Why" or "What" question.  My suggestions offered a work-around by replacing the tool that clearly doesn't meet your (your client's) performance criteria.  You will find that many EE experts will question the premise of questions.

If AA was selected/licensed as a tool and you are not satisfied with its load performance, I suggest the software evaluation process is flawed and should warrant some analysis and reconsideration.
0
 
LVL 1

Author Comment

by:philkryder
ID: 37042409
it doesn't matter that it did come in late
and
I'm happy to award BillBach the points.
I only noted that it came in AFTER my request to close,
to provide you rational
that
 AT THE TIME that I requested closure,
I had NOT received an acceptable answer.

while YOU may think that the questions should have been WHY or WHAT
and YOU may think that replacing AA is a viable solution,
I
am the customer who pays for this service
and
I
don't agree.
I
don't really care WHY it takes so long to load
I
don't have any idea WHAT your "WHAT" question would have been or should have been.
I
am not able to change products.
I
simply wanted the question answered.


I don't understand why folks get so "torqued" up
when they "stretch the envelop" to try to help by answering a question that wasn't asked,
and then
they can't graciously accept that their suggestion is wide of the mark.

The original question was clear and unambiguous.
For some folks SOME of the suggestions MIGHT have been helpful.
For ME they were not.

pax.

I'll give BILLB the points and move on.
Phil

 

0
 
LVL 1

Author Closing Comment

by:philkryder
ID: 37042415
I've done timings with RAM disk and it is only slightly faster than loading off of the C drive.

I think that as noted,
AA has to do a lot of work when loading the exe before actually executing it.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

760 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

18 Experts available now in Live!

Get 1:1 Help Now