[PATCH] graphmod: compute revs once (issue4782)

Gregory Szorc gregory.szorc at gmail.com
Mon Sep 7 13:18:43 CDT 2015


On Mon, Sep 7, 2015 at 7:48 AM, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sun, 06 Sep 2015 17:25:22 -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1441585277 25200
> > #      Sun Sep 06 17:21:17 2015 -0700
> > # Node ID be9e3d1399d1f4a4789ff5c0980d5de48aeb61d2
> > # Parent  7187f6e923d55cf6b7e6910d24645f303db671ee
> > graphmod: compute revs once (issue4782)
> >
> > This makes `hg wip` on my Firefox clone ~4x faster than 3.5.1 (~6.5s to
> > ~1.5s). This is after a regression in @ to ~45s.
> >
> > Patch suggested by Yuya Nishihara in the bug tracker.
> >
> > diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
> > --- a/mercurial/graphmod.py
> > +++ b/mercurial/graphmod.py
> > @@ -259,8 +259,10 @@ def dagwalker(repo, revs):
> >
> >          for mpar in mpars:
> >              gp = gpcache.get(mpar)
> >              if gp is None:
> > +                # Only compute revs once.
> > +                revs = revset.baseset(revs)
> >                  gp = gpcache[mpar] = revset.reachableroots(repo, revs,
> [mpar])
>
> Oops, maybe I should avoid recreating baseset if it is already a baseset.
>

I'll be busy today. Since this is your idea, feel free to send a V2 and
I'll happily get out of the way. Otherwise, I can fix this tomorrow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150907/3769d1fa/attachment.html>


More information about the Mercurial-devel mailing list