John Nagle <na...@animats.com> writes: > Unoptimized reference counting, which is what CPython does, isn't > all that great either. The four big bottlenecks in Python are boxed > numbers, attribute lookups, reference count updates, and the GIL.
The performance hit of having to lock the refcounts before update has been the historical reason for keeping the GIL. The LOCK prefix takes something like 100 cycles on an x86. Is optimizing the refcount updates going to anywhere near make up for that? Python's "with" statement as an approach to RAII has seemed ok to me. I can't think of a time when I've really had to use a finalizer for something with dynamic extent. They've always seemed like a code smell to me. -- http://mail.python.org/mailman/listinfo/python-list