Sikuli uses 100% cpu with wait(image) and observe()
- Last updated by:
- RaiMan on on 2011-09-23
This is based on Sikuli X 1.0rc3.
In the standard during search operations Sikuli is searching for the visual object continuously. This leads to 100% cpu, since this process is just looping continuously through byte arrays.
This is ok, for find operations, since you expect them to be finished as fast as possible.
If this is a problem for you during a longer wait or observe, feel free to reduce the scan rate to once per second or even less often. This reduces the cpu usage. E.g. searching once every 2 seconds might be acceptable, if you expect something to appear within the next 60 seconds.
--- the test script:
setROI = selectRegion()
SCREEN.isFound = False
print "in handler"
observe(FOREVER, True) # runs in background
while not SCREEN.isFound:
"logo.png" was the Sikuli logo in a browser window, that I could hide and reveal by scrolling.
Currently (rc3) the IDE "remembers" the Settings.
I never had any problems with this behavior of Sikuli, neither on Mac nor on Windows - at least with the foreground apps and their responsiveness.