[PATCH 2 of 2] parsers: add a C function to pack the dirstate

Matt Mackall mpm at selenic.com
Tue May 22 16:56:46 CDT 2012


On Tue, 2012-05-22 at 14:38 -0700, Bryan O'Sullivan wrote:
> > > +     if (dirstate_unset)
> > > +             PyObject_GC_UnTrack(dirstate_unset);
> >
> > Any reason for the PyObject_GC_UnTrack call?
> >
> 
> Keeping a long-lived object out of the GC's root set.

The real win is in keeping the GC from wasting its time traversing a) a
potentially very large object or b) large numbers of distinct, small
objects which we know a priori contains no external references and thus
no cycles.

So it definitely makes sense for most dirstate entries, and the dirstate
dict itself, but I don't think it matters for these singletons.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list