#2178 closed task (fixed)
better monotonic clock for win32
Reported by: | Antoine Martin | Owned by: | totaamwin32 |
---|---|---|---|
Priority: | major | Milestone: | 3.0 |
Component: | platforms | Version: | 2.4.x |
Keywords: | Cc: | stdedos@… |
Description
Using QueryUnbiasedInterruptTime which requires windows 10, or QueryPerformanceCounter (windows 2000 and later).
Change History (5)
comment:1 Changed 3 years ago by
Cc: | stdedos@… added |
---|
comment:2 Changed 3 years ago by
Owner: | changed from Antoine Martin to totaamwin32 |
---|---|
Status: | new → assigned |
comment:3 Changed 3 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
python2 doesn't have time.perf_counter
, here's the data:
$ PYTHONPATH=../build/exe.mingw-2.7/lib python2 -m timeit "from xpra.os_util import monotonic_time;monotonic_time()" 1000000 loops, best of 3: 0.577 usec per loop $ python2 -m timeit "from time import clock;clock()" 1000000 loops, best of 3: 0.84 usec per loop
r23001 adds a QueryPerformanceCounter
implementation.
New data:
$ PYTHONPATH=../build/exe.mingw-2.7/lib python2 -m timeit "from xpra.os_util import monotonic_time;monotonic_time()" 1000000 loops, best of 3: 0.563 usec per loop $ PYTHONPATH=../build/exe.mingw-3.7/lib python3 -m timeit "from xpra.os_util import monotonic_time;monotonic_time()" 200000 loops, best of 5: 1.06 usec per loop
So we lost a tiny bit of performance with python3 (not with python2), but we gained precision.
The python2 time.clock uses QueryPerformanceCounter
, but it is deprecated in python3.
comment:5 Changed 16 months ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2178
Note: See
TracTickets for help on using
tickets.
Interesting results: