Message402779
Hi,
I was looking at the implementation of Semaphore and BoundedSemaphore in threading.py and I saw that `notify` is called on a loop n times while it supports an n parameter.
https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/threading.py#L479
Unless I am missing something, removing the loop and replacing it with self._cond.notify(n) will slightly improve performance by avoiding the function call overhead.
I can prepare a Pool Request if the change is acceptable.
Thanks, |
|
Date |
User |
Action |
Args |
2021-09-28 13:32:03 | besi7dollma | set | recipients:
+ besi7dollma |
2021-09-28 13:32:03 | besi7dollma | set | messageid: <1632835923.15.0.15993520004.issue45311@roundup.psfhosted.org> |
2021-09-28 13:32:03 | besi7dollma | link | issue45311 messages |
2021-09-28 13:32:03 | besi7dollma | create | |
|