Optimization targets - refcount
April 15, 2004
1:08 p.m.
Mike Pall:
About GC: yes, refcounting is the silent killer. ... Py_DECREF is awful ... > 3500 locations
Is it always needed? What if a few common (constant, singleton) objects (such as None, -1, 0, 1) were declared immortal at compile-time? They would be created at initial load in a special untracked pool, and their tp_dealloc would do nothing. The slot for tracking references would still be there, but could be ignored -- even if it went negative. Since the reference count no longer has to be correct (for these objects), the reference counting macros could optimize to nothing when they know at compile time that they'll have one of these constant objects. -jJ
8039
Age (days ago)
8042
Last active (days ago)
10 comments
9 participants
participants (9)
-
"Martin v. Löwis" -
Aahz -
Greg Ewing -
Guido van Rossum -
Jeff Epler -
Jewett, Jim J -
Mike Pall -
Paul Prescod -
Phillip J. Eby