Long startup .exe

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
ravett
Newbie
Posts: 18
Joined: Thu Nov 26, 2020 2:02 am

Long startup .exe

Post by ravett » Sat Dec 12, 2020 3:14 pm

Hello

It is very important that the script runs as soon as possible.

If the script is run from the Macro application, then it comes out much (about 1-2s), faster than running the .exe file.

But it turned out that it is necessary to run from .exe.

How can you speed up this moment?

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long startup .exe

Post by Grovkillen » Sat Dec 12, 2020 3:54 pm

My experience is the opposite. Compiled macros run faster than from within the editor.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
ravett
Newbie
Posts: 18
Joined: Thu Nov 26, 2020 2:02 am

Re: Long startup .exe

Post by ravett » Sat Dec 12, 2020 4:09 pm

Grovkillen wrote:
Sat Dec 12, 2020 3:54 pm
My experience is the opposite. Compiled macros run faster than from within the editor.
Hmm ...

What is usually associated with the startup speed of .exe?

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long startup .exe

Post by Grovkillen » Sat Dec 12, 2020 5:40 pm

Depends on what commands your script is using.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
ravett
Newbie
Posts: 18
Joined: Thu Nov 26, 2020 2:02 am

Re: Long startup .exe

Post by ravett » Sat Dec 12, 2020 5:49 pm

Grovkillen wrote:
Sat Dec 12, 2020 5:40 pm
Depends on what commands your script is using.
My script is 2 lines)
Press Shift
Press F3
It seems that the matter is not in the script, but in the .exe itself
The script works quickly.
It takes a long time to start.

I wonder why the executable file is more than 2MB?

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long startup .exe

Post by Grovkillen » Sun Dec 13, 2020 2:57 am

The exe contains the "engine" to run your script. So the minimum size will always be around 2.2MB.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
ravett
Newbie
Posts: 18
Joined: Thu Nov 26, 2020 2:02 am

Re: Long startup .exe

Post by ravett » Sun Dec 13, 2020 4:57 am

Grovkillen wrote:
Sun Dec 13, 2020 2:57 am
The exe contains the "engine" to run your script. So the minimum size will always be around 2.2MB.
I made the same script (if I can call it 2 lines :)) in AutoHotKey and created an executable .exe file in it

It starts much faster there.

So it's not about the power of the PC as I thought before.

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long startup .exe

Post by Grovkillen » Sun Dec 13, 2020 6:52 am

I rarely use keyboard commands so i cannot tell but I don't see any delay at all. Perhaps the "engine" is adding a small delay when using the keyboard commands?
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Long startup .exe

Post by Marcus Tettmar » Mon Dec 14, 2020 9:55 pm

It is logical that compiled macros will take longer to start than macros in Macro Scheduler where Macro Scheduler is already running.

An analogy would be: opening a word document by double clicking the document when Word is not already opened vs opening a word document from within word which is already open. You'd expect the latter to be quicker because Word itself is already open.

Running a compiled macro requires the macro interpreter to load. When Macro Scheduler is running everything the script needs to run is already present.

But that said, as others have noticed here, any delay is barely negligible to most humans on most systems ;-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Long startup .exe

Post by PepsiHog » Tue Dec 22, 2020 8:58 pm

Hello,
Just reading this post, I thought maybe the problem is really it's running too fast. Have you tried adding a delay as the first line? Not much just maybe .5 or .2 (wait>.2)

You may also want to add a ridiculous delay, just for testing purposes. You could also add a mdl> at the start so you can visually see when it started.

It also occurs to me that you are not setting any focus. You are just throwing it out there and hoping the right "thing" catches it. Could something else be absorbing the strokes?

PepsiHog

I also have never experienced anything of this nature with exes.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts