[Python-Dev] Making python C-API thread safe (try 2)

Andrew Bennetts andrew-pythonlist at puzzling.org
Tue Sep 16 23:11:44 EDT 2003


On Wed, Sep 17, 2003 at 05:58:55AM +0300, Harri Pesonen wrote:
> But if the reference count is negative for allocated objects, then you 
> already have a bug. I mean that the count is never negative when the 
> application works correctly. The object is already deallocated when the 
> count reaches zero, so checking for negative counts is (usually) 
> superfluous. Python gets slightly faster if you just remove this check 
> (from release version).

Have you benchmarked whether removing this check makes any significant, or
even measurable, difference to the speed of a Python program?

I'm not convinced that the benefits of this outweigh the costs.

-Andrew.






More information about the Python-list mailing list