Startup of commandline sikuli is Slow

Asked by Learner on 2014-05-21

While running sikuli from commandline is very slow . Upon entering the command it takes minimum 6 to 8 sec for execution to start ( mean while Yellow color splash screen with "starting please wait" is coming ) .

Run same script through sikuli IDE is faster , I noticed if you run through IDE first time again splash screen is coming for around 3 sec showing "setup environment" but on second run onwards splash screen is not coming and is quite fast .

So my question is generally commandline command should work faster than IDE because IDE loading itself will take some RAM which might slow it up ( but here it is reverse )? . Also how can the startup time can be decreased . My System has decent config of intel i5 with 4gb ram

Command i'm using to run script1.sikuli ::

java -Dsikuli.FromCommandLine -jar <...>\Sikuli\sikuli-ide.jar -r "<...>\SikuliScripts\script1"

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Learner
Solved:
2014-05-21
Last query:
2014-05-21
Last reply:
2014-05-21
RaiMan (raimund-hocke) said : #1

This is currently by design ;-)

At startup of SikuliX (no matter if IDE or script run from command line) tons of Java classes have to be loaded and pre-interpreted which adds up to some seconds (with IDE this is split in 2 parts: IDE-startup and first script run ), so it feels a bit smoother.

In IDE the second+ script run starts immediately, because we have a running interpreter, that is just advised to run the script (which on the other hand leads to some weird problems).

The problem is on the list with rather low priority.

What is missing is some background script runner.
The solution most often used, since it can also be used with remote machines is XML-RPC.
You have a running server, that is advised bay a client to do something. This works as fast as the 2nd+ run in the IDE.

Another funny option is to have the IDE run, while running a script, that "sikuli's" the IDE, to run a script (one of some, that might be preloaded).

Learner (gopikrish2000) said : #2

Thanks RaiMan for the reply . Background script runner is having low priority , so it willnot come in near future , OK .

Voodoo (voodoo-master-6666) said : #3

I also noticed this long delay at start up, but it seems that the new Sikuli version 1.1.0 delays even longer for me,
up to 10 seconds compared to the old version 1.0.1 which takes only up to 5 seconds.

This behavior was observed on Windows 7 x64 with Java 1.7.0.71 64bit and on old Intel Core Duo CPU.

zzzzzz (cmlewis89) said : #4

I would love to have a background runner or something more performant to run scripts on demand. I have some short simple scripts that help me automate short tasks like navigating to specific menus within apps.
Eg: Opening a specific private message thread within Discord.

Some of these scripts are run from Alfred workflows so I am waiting for them to run and complete before I can continue using my computer. My current solution is to have an instance of the Sikuli IDE open with the scripts open and then have the workflow execute the run command on the IDE. This is not ideal. :/

It would be great if I could compile the scripts into self-contained binaries that ran fast or if there was some background runner that contained the Sikuli runtime so I could execute scripts from command-line quickly.

zzzzzz (cmlewis89) said : #5

I would love to have a background runner or something more performant to run scripts on demand. I have some short simple scripts that help me automate short tasks like navigating to specific menus within apps.
Eg: Opening a specific private message thread within Discord.

Some of these scripts are run from Alfred workflows so I am waiting for them to run and complete before I can continue using my computer. My current solution is to have an instance of the Sikuli IDE open with the scripts open and then have the workflow execute the run command on the IDE. This is not ideal. :/

It would be great if I could compile the scripts into self-contained binaries that ran fast or if there was some background runner that contained the Sikuli runtime so I could execute scripts from command-line quickly.