Message183811
It should be possible to optimize threading.Event.wait() to not acquire the condition when the event is already set. Patch attached.
Without patch:
$ ./python -m timeit -s "import threading; e = threading.Event(); e.set()" "e.wait()"
1000000 loops, best of 3: 0.466 usec per loop
With patch:
$ ./python -m timeit -s "import threading; e = threading.Event(); e.set()" "e.wait()"
10000000 loops, best of 3: 0.19 usec per loop |
|
Date |
User |
Action |
Args |
2013-03-09 11:42:27 | pitrou | set | recipients:
+ pitrou, neologix, sbt |
2013-03-09 11:42:27 | pitrou | set | messageid: <1362829347.05.0.139700597073.issue17389@psf.upfronthosting.co.za> |
2013-03-09 11:42:26 | pitrou | link | issue17389 messages |
2013-03-09 11:42:26 | pitrou | create | |
|