sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #17228
[Bug 1162649] [NEW] Region.exists() sleeps even when timeout set to 0
Public bug reported:
The Region.exists() function has an unnecessary sleep in it, even when
the wait time is set to 0 (eg. Region.exists("myimage.png", 0). The
shortest possible sleep time is 1/Settings.WaitScanRate, with
WaitScanRate set to 1000. Values for WaitScanRate > 1000 are ignored,
and less than 1000 result in a longer wait time. I believe that when
exists() is called with a 0 wait time, then after doing the find it
should immediately return the result without sleeping for
1/Settings.WaitScanRate seconds first.
All that said, as a workaround, the findNow() function can be used for an immediate find instead, as it does not have the extra delay (and is in fact unaffected by the WaitScanRate setting). So, in code, rather than using:
Region.exists("image.png", 0)
instead use:
(findNow("image.png") != None)
This was observed in Sikuli X 1.0-rc3 (r905), on a Windows 7 64-bit OS.
Side note: one might reasonably assume that an extra delay of 1/1000 of
a second might be considered negligible / inconsequential, but I am
using Sikuli in an application which is being tightly performance tuned,
and the time to determine whether an image exists in a region only takes
about 0.2 milliseconds, so the extra 1 millisecond added on top really
slows things down :-).
** Affects: sikuli
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1162649
Title:
Region.exists() sleeps even when timeout set to 0
Status in Sikuli:
New
Bug description:
The Region.exists() function has an unnecessary sleep in it, even when
the wait time is set to 0 (eg. Region.exists("myimage.png", 0). The
shortest possible sleep time is 1/Settings.WaitScanRate, with
WaitScanRate set to 1000. Values for WaitScanRate > 1000 are ignored,
and less than 1000 result in a longer wait time. I believe that when
exists() is called with a 0 wait time, then after doing the find it
should immediately return the result without sleeping for
1/Settings.WaitScanRate seconds first.
All that said, as a workaround, the findNow() function can be used for an immediate find instead, as it does not have the extra delay (and is in fact unaffected by the WaitScanRate setting). So, in code, rather than using:
Region.exists("image.png", 0)
instead use:
(findNow("image.png") != None)
This was observed in Sikuli X 1.0-rc3 (r905), on a Windows 7 64-bit
OS.
Side note: one might reasonably assume that an extra delay of 1/1000
of a second might be considered negligible / inconsequential, but I am
using Sikuli in an application which is being tightly performance
tuned, and the time to determine whether an image exists in a region
only takes about 0.2 milliseconds, so the extra 1 millisecond added on
top really slows things down :-).
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1162649/+subscriptions
Follow ups
-
[Bug 1162649] Re: X-1.0rc3: Region.exists(img, 0) waits minimum time given by WaitScanRate even when search time is shorter
From: RaiMan, 2013-08-14
-
[Bug 1162649] Re: X-1.0rc3: Region.exists(img, 0) waits minimum time given by WaitScanRate even when search time is shorter
From: RaiMan, 2013-04-05
-
[Bug 1162649] Re: X-1.0rc3: Region.exists(img, 0) waits minimum time given by WaitScanRate even when search time is shorter
From: Peter Zejda, 2013-04-05
-
[Bug 1162649] Re: X-1.0rc3: Region.exists(img, 0) waits minimum time given by WaitScanRate even when search time is shorter
From: RaiMan, 2013-04-03
-
[Bug 1162649] Re: X-1.0rc3: Region.exists(img, 0) waits minimum time given by WaitScanRate even when search time is shorter
From: Peter Zejda, 2013-04-02
-
[Bug 1162649] Re: Region.exists() sleeps even when timeout set to 0
From: RaiMan, 2013-04-01
-
[Bug 1162649] Re: Region.exists() sleeps even when timeout set to 0
From: RaiMan, 2013-04-01
-
[Bug 1162649] Re: Region.exists() sleeps even when timeout set to 0
From: RaiMan, 2013-04-01
-
[Bug 1162649] [NEW] Region.exists() sleeps even when timeout set to 0
From: Peter Zejda, 2013-04-01
References