[Python-Dev] Optimization targets - refcount (original) (raw)
Guido van Rossum guido at python.org
Fri Apr 16 10:58:17 EDT 2004
- Previous message: [Python-Dev] Optimization targets - refcount
- Next message: [Python-Dev] Optimization targets - refcount
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think the idea is more that you could skip the 'PyINCREF(PyNone)', which is a fairly common prelude to 'return PyNone'. You'd set their refcounts to the maximum possible value, and the deallocation function would simply reset the refcount to maximum again.
I'm not sure, however, that this would be common enough to be helpful. It seems to me PyINCREF should effectively translate to only a single machine instruction or two. I mean, it's just incrementing an integer whose address is known at compile time.
I vaguely recall that this was proposed and perhaps even tried before, and not found to make a difference.
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Optimization targets - refcount
- Next message: [Python-Dev] Optimization targets - refcount
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]