← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #184252]: How to make scripts faster beyond mouse delay of 0

 

Question #184252 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/184252

    Status: Open => Answered

RaiMan proposed the following answer:
These "scan rates" are only relevant, when you are waiting for something
to appear. You might reduce the scan rate to reduce Sikuli's cpu usage
during these "unsuccessful" searches (if you know, you have to wait for
something 10 seconds, it might be enough to try every second only).

If you say nothing else, the standard waiting time is 3 seconds.

You might check your search performance in your case by using:

start = time.time()
print exists("some-image.png", 0) # prints the match if found
print time.time()-start # search time in seconds

The exists() with second parameter as 0 searches only once (on the whole
screen in this case).

using reg.exists() with some restricted Region would show you the
possible increase in performance.

Nevertheless, it is always worth to check ANY possibilities to restrict
the region somehow, search for a few key visuals and try to calculate
the rest based on some known geometric aspects of your GUI.

If you send me your script and a screenshot zipped together to my mail
at https://launchpad.net/~raimund-hocke, I will have a look at it.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.