This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients neologix, pitrou, sbt
Date 2013-03-09.11:42:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362829347.05.0.139700597073.issue17389@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-03-09 11:42:27pitrousetrecipients: + pitrou, neologix, sbt
2013-03-09 11:42:27pitrousetmessageid: <1362829347.05.0.139700597073.issue17389@psf.upfronthosting.co.za>
2013-03-09 11:42:26pitroulinkissue17389 messages
2013-03-09 11:42:26pitroucreate