Author kristjan.jonsson
Recipients amaury.forgeotdarc, kristjan.jonsson, loewis, pitrou, rhettinger, stutzbach, tim.peters
Date 2010-07-20.21:03:43
SpamBayes Score 0.00262766
Marked as misclassified No
Message-id <1279659826.87.0.0279199412004.issue9141@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that this is not the _optimal_ solution, and that when you are collecting stuff, say a list of many items, it will cause X indirect calls to all of the things in the list.

My counterargument is, however, that all those items will, if collected, be handed off to the final Py_DECREF with all the baggage that that entails, ultimately resulting in PyObject_Free or PyMem_Free.  An extra indirect call, (only for unreachable objects, btw, which is only a small objects of all objects visited during a GC pass) should not play a significatn part in the process.

An alternative to this extra tp_traverse() pass, would be to flag objects that report that they are or are not collectable, with a special  value in gc_refs, probably a bitmask.  But this would be a much more intrusive change in an algorithm that is far from simple, and so need very rigorous review and testing.
History
Date User Action Args
2010-07-20 21:03:47kristjan.jonssonsetrecipients: + kristjan.jonsson, tim.peters, loewis, rhettinger, amaury.forgeotdarc, pitrou, stutzbach
2010-07-20 21:03:46kristjan.jonssonsetmessageid: <1279659826.87.0.0279199412004.issue9141@psf.upfronthosting.co.za>
2010-07-20 21:03:44kristjan.jonssonlinkissue9141 messages
2010-07-20 21:03:43kristjan.jonssoncreate