← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213048]: Do large or small patterns match quickest?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
It is not the size of the target, that influences speed significantly,
it is the size of the region, that has to be searched.

So if you want to optimize a script according performance, then you have
to restrict the search region as much as possible to the area, where the
target should be.

Especially in situations like yours (automating games e.g. is much
trickier according this approach), you normally have a well structured
screen, where you can concentrate on  specific areas in specific steps
of your script.

So a script, that is layed ot to be optimized according performance,
always starts with defining regions, that correspond to the visual
layout of an application (title bar, tool bar, menu section, left
navigation panel, an information window, the center main window, ....).
So if you want to click a symbol in a toolbar,

instead of saying
click(btnSymbol)

you use
toolbar.click(btnSymbol)

which might be up to ten times faster, depending on your screen size and
the size of region toolbar.

In most cases, this defining of key regions can be done by serching for
one fixed anchor image (e.g. an app logo) and then defining all the
other regions relative to this anchor region.

Come back if you need more help.

Corresponding faqs:
faq 1607 speed
faq 1686 evaluate layout

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