[PATCH 1 of 2] bdiff: early pruning of common prefix before doing expensive computations

Augie Fackler raf at durin42.com
Fri Dec 2 16:06:24 EST 2016


On Sun, Nov 27, 2016 at 10:29:26AM -0500, Augie Fackler wrote:
>
> > On Nov 24, 2016, at 1:26 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> >
> >>>>   diff --git a/mercurial/bdiff_module.c b/mercurial/bdiff_module.c
> >>>>   --- a/mercurial/bdiff_module.c
> >>>>   +++ b/mercurial/bdiff_module.c
> >>>>   @@ -61,12 +61,12 @@ nomem:
> >>>>
> >>>>    static PyObject *bdiff(PyObject *self, PyObject *args)
> >>>>
> >>>>
> >>>> Implementing this in the Python module means that CFFI/PyPy won't be able
> >>>> to realize the perf wins :(
> >>>>
> >>>> How do you feel about implementing this in bdiff.c?
> >>>
> >>> I guess other logic also should move from bdiff_module to bdiff.c? This was
> >>> just the easy way to hook in before the two sides got split into lines.
> >>
> >> If you're willing, I'd be a big fan of this change happening in such a
> >> way that pypy gets the wins too. What say you?
> >
> > So, what is the status of this? Should we expect a V2 with the code living in bdiff.c?
>
> I’m happy for it to land as-is, but was hoping we could get a version that is factored out for pypy use.

Given the enormous performance win, I've gone ahead and queued
these. Hopefully we can clean them up to help pypy at some point as
well.


More information about the Mercurial-devel mailing list