sikuli is too slow? I can speed up?

Asked by leoxs

I see sikuli is slow, I don't know why, maybe is my PC, but it takes like 1 or 2 seconds to verify de image and click it, its possible to speed up this? like half second at least?

sorry, my english is bad
thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

The smaller the region, that is to be searched, the faster.

So if ever possible tell Sikuli in what area to search.

I guess you are working on a rather big screen with a rather slow processor/little ram.

the principle:
instead of
click(some_image) # searches whole screen

use
some_region.click(some_image)

there are many ways to define a suitable region: just look in the docs and the tons of examples in the net.

Revision history for this message
leoxs (quieroguita) said :
#2

yes, im testing with a browser game

nice, thanks for the help, I will try it

Revision history for this message
RaiMan (raimund-hocke) said :
#3

come back if you need more tips.

Revision history for this message
leoxs (quieroguita) said :
#4

well, its not really a lot quicket, but yes, I win some time
Maybe my code is wrong? I do something like:

if reg.exists(a)
    reg.click(a)

it is searching 2 times? I use the "exists" because I need to wait for the image, and this dont have exact time

sorry for my english again

Revision history for this message
RaiMan (raimund-hocke) said :
#5

click(reg.wait(a, x))

where x is the time in seconds to wait max

with exists:

if reg.exists(a, x):
    click(reg.getLastMatch()) # no search again
else:
    exit(1)

with version 1.0.1+ this goes:

reg.wait(a,x)
reg.click() # defaults to getLastMatch() in reg

or:
if reg.exists(a, x):
    reg.click()

Can you help with this problem?

Provide an answer of your own, or ask leoxs for more information if necessary.

To post a message you must log in.