← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #171253]: Using Regions and Match efficiently

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
This is a historical oddity in the API.

The first parameter to  many of the Sikuli functions is PSMRL, which stands for the options
P - Pattern, S - String, M - Match, R - Region, L - Location.

Only for PS it is more efficient to use a restricting region, since this
makes the search faster (up to ten times and more):

reg.click(PS) instead of click(PS)

which implicitly binds to SCREEN ( constant object Screen(0) ) and so
searches the whole screen.

Using  click(MRL) or reg.click(MRL) does not matter in sense of performance, since MRL already define a click point by there object contents (no time consuming search necessary). And in both cases, the click() is bound to a Region object, so no difference (in case click() it is the region SCREEN).
So using reg.click(MRL) only makes sense for documentation/code readability: saying, look I am clicking somewhere inside this region.

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