[New-bugs-announce] [issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement
report at bugs.python.org
Tue Sep 28 09:32:03 EDT 2021
New submission from Besart Dollma <besi7dollma at gmail.com>:
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.
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.
components: Library (Lib)
title: Threading Semaphore and BoundedSemaphore release method implementation improvement
versions: Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce