← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #241902]: What is the specification of region.setWaitScanRate(float waitScanRate)

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
since you are talking about region.setWaitScanRate() I suppose you are
using version 1.0.1 (hoping the latest version built sSept 12th).

WaitScanRate simply means the following:
After find has tried the first time to find the target, it waits (1 second)/WaitScanRate including the elapsed time for the find operation (the average elapsed time is about 0.5 seconds, when searching the whole screen down to some milliseconds with a very small search region) before it tries again. This is repeated until the given max-waiting-time is reached (standard 3 seconds).

Since the standard scan rate is 3, the step waiting time is 0.3 seconds.

So setting the scan rate to 1, simply means, Sikuli waits 1 second
before the next try.

Setting it to 9, means the step waiting time is 0.1 seconds, so in
average the next try will start immediately.

Scan rate should not influence "performance", besides the fact, that
scan rates < 1 might lead to unnecessary waits.

Adjusting the scan rate should only be taken into account, if you have
problems with the CPU usage (Sikuli find is 100% number crunching)

Conclusion:
For normal operation, one should not set the scan rate (neither the general nor the specific for the region).

The only case, where it makes sense: you are searching small targets in
small regions, so the search time is some milliseconds. waiting 300
milliseconds would slow down the continues search, so you set the scan
rate to 50 and get about 10 to 30 search hits per second.

Version 1.1.0 will have additional optimisations to increase the search
hits per second.

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