-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Description
Feature or enhancement
I think threading.Condition.notify() could be sped up by avoiding some unnecessary work. Condition.notify() creates a _deque every time it is called, and it seems like this step can be eliminated. This should speed up notify() without sacrificing readability. The for loop at the end of the function would most likely need to be slightly tweaked to accommodate this change.
Pitch
This change should speed up Condition.notify(), which would also speed up operations on queue.Queue, since the Queue class uses Condition objects extensively. The speedup for Queue could be significant, because Queue appears to spend a significant portion of it's time in notify() (or at least it did when I profiled a simple program that was using Queue).
If I'm right that this can be sped up significantly without sacrificing readability, should I make a PR for it?