Link to home
Start Free TrialLog in
Avatar of philkryder
philkryder

asked on

? how can I make an EXE load faster ?

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
Avatar of Danny Child
Danny Child
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of philkryder
philkryder

ASKER

anything on pre-fetching the exe and having it remain resident for the life of the windows session?
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??
it's an exe that I wrote using Automation Anywhere to step thru web pages and paste data.
It is about 2meg.


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

moderators - am I in the wrong zone? any help ?
any help?
moderator - is this in the wrong section?
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.
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
How long does it take to load?
Have you added this .exe to the  exceptions list in the antivirus and firewall?
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 ? --

how are you measuring the 5 second load time?
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.
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
https://www.experts-exchange.com/A_2449.html

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

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
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.
mods - please delete no points.
I've requested that this question be deleted for the following reason:

no answer met my needs
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
@Phil

There were several work-around suggestions made in this thread.  Did you explore those?
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?
ASKER CERTIFIED SOLUTION
Avatar of Bill Bach
Bill Bach
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@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.
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

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

@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.
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.

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.
@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.
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

 

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.