operating system/hardware/software setup? (performance aspects)

Asked by funtikar

Currently I'm using my departments which is an ancient DC5800 SFF with C2D cpu ,6gb ram with 1280x1024 monitor resolution.

I think it runs quite well for what its worth and what I'm doing using python/jython:
- modern web data entry with its inconsistent web response.
- So looping through a .csv list with lots of "wait"s and image matching / not using Tesseract at the moment

How would I go to with upgrading my setup for optimal script performance or image recognition performance.
Would sticking to a smaller resolution monitor/4:3 instead of 16:9 or wider be better for Sikuli?

interested to know the specific of what Raimund's Development environment too
My Development environment

Java 17 (current JDK LTS release)
Source and target level for Java is version 11
Maven project
Windows 11 latest (Pro 64-Bit)
latest macOS 12 (Monterey) on Intel and M1 machines
Ubuntu latest LTS version running in Oracle VM VirtualBox on Windows 10
Using IntelliJ IDEA CE in all environments

Question information

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

The only performance critical aspect with SikuliX is the image search, that is done internally with OpenCV matchTemplate.
This feature calculates the similarity of the given image to search for at every possible position in the given image to search in (usually an internally created screenshot of the given Screen or Region). All this is pixel-based and results in very CPU-intensive array/matrix ops.

An example:
Screensize: 1280x1024 pixels means about 1.3 M pixels (imgA).
Image to search: 100x100 pixels means 10 K pixels (imgB)
The exact number of pixels, that are possible top left corners of imgB in imgA: sizeImgA - sizeImgB = 1.300.720 pixels

Result:
- with increasing size of imgA (e.g. larger screens) the search time increases (more than linear)
- with a decreasing size difference of the 2 images search time decreases

Conclusion:
Make imgA as small as possible using appropriate Region features.

Having this in mind, when creating workflows in SikuliX, monitor size does not really matter.

General advice:
To get responsive workflows on actual GUI's (web or local) you should be sure, that an image search does not take longer than 300 milli-seconds (with the standard scan rate of 3 searches per second).
You might check this in your environment with this script:

Settings.CheckLastSeen = False # do not remember matches
reg = Region(x, y, w, h) # or any other feature that gives a Region object
img = "searchImage.png"
start = time.time()
reg.exists(img, 0) # one search only
# exists(img, 0 # would search the whole screen
print time.time() - start

you get the search time in seconds.

So you could check the SikuliX performance in different environments.
The results might help, to decide for a minimum machine needed.

--- Settings.CheckLastSeen
This is True in the standard and means that matches are remembered for search images during the same script run. With the next search it is first checked, wether the image is still in the remembered position. If not a search in the given region is done again.

The mentioned still-there check only lasts some milli-seconds depending on image size.

--- Example on my macOS M1 (2240 x 1260 pixels):
6K pixels search image: 300 msec on whole screen, 100msec in top left quarter of screen
check-still-there: 10 msec im both cases

Revision history for this message
funtikar (funtikar) said :
#2

okay now I got what I actually needed.. and well explained with example...
Welcome back by the way.