[PATCH 3 of 7] parsers: avoid PyList_Append when parsing obs markers

Augie Fackler raf at durin42.com
Thu Mar 16 12:50:38 EDT 2017


On Mon, Mar 13, 2017 at 10:24:21PM -0700, Gregory Szorc wrote:
> On Mon, Mar 13, 2017 at 10:15 PM, Gregory Szorc <gregory.szorc at gmail.com>
> wrote:
> Assuming there is some truth to the numbers, holy cow the overhead of
> PyObject creation is crazy. I suddenly feel like auditing the C code for
> everywhere we're instantiating PyObjects before it is necessary. I know we
> do this in the revlog index. I wonder if dirstate is impacted...

Yeah, PyObject allocation can be pretty nasty. In my toy rust version
of fm1readmarkers, it's 100x faster than the C code was, then 3x
slower overall due to time spent copying data into PyObjects.


More information about the Mercurial-devel mailing list