[PATCH] nogc: do disable gc for CPython

Augie Fackler raf at durin42.com
Wed May 24 17:32:09 EDT 2017


On Wed, May 24, 2017 at 02:07:25PM -0700, Jun Wu wrote:
> Excerpts from Gregory Szorc's message of 2017-05-23 18:03:53 -0700:
> > Since this patch sounds like it has more to do with PyPy, then
> > implementation should check for =pypy, not !=cpython. Other than that, I'm
> > fine keeping the GC in place on PyPy, as its JIT should mitigate impact
> > from garbage spewing code.
>
> I'll change it to PyPy.

Please change it to not-cpython, rather than pypy specifically: I'd
expect our code to be fine in Jython's GC as well.

>
> > Also, regarding this whole no gc concept, I'll argue that any operation
> > needing to disable GC should be implemented in C in such a way that it
> > isn't instantiating thousands of CPython objects. So many of our C routines
> > are relatively slow (revlog index, obsmarkers, dag walking, etc) because
> > they operate on PyObject instead of raw C data structures. If we remove
> > PyObject from critical path code, we eliminate most GC concerns and likely
> > make execution at *least* 5x faster.
>
> There are multiple ways to solve perf issues. For obsmarkers, building an
> index is a time complexity change that reduces O(N) to O(1-ish). It'll
> greatly reduce object count. After that, constant time changes (like not
> creating Python tuples) may become less important.
>
> Regardless, this nogc stuff is an easy win restoring what we have before
> 279cd80059.

Yeah, as a stopgap it seems okay.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list