[PATCH STABLE V2] hgweb: cache fctx.parents() in annotate command (issue5414)

Yuya Nishihara yuya at tcha.org
Sat Nov 5 22:31:04 EDT 2016


On Sat, 05 Nov 2016 09:41:14 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1478363887 25200
> #      Sat Nov 05 09:38:07 2016 -0700
> # Branch stable
> # Node ID 1258a74819e5c2b4904d11c71231e3b3f33a0aa1
> # Parent  e5cc44ea12de681d971fcbebb65a7fb71fd1c3c7
> hgweb: cache fctx.parents() in annotate command (issue5414)

Queued this, thanks.

> Looking at the code of basefilectx.parents(), there is room for
> further improvements. Notably, we still perform redundant calls to
> filelog.renamed() and basefilectx._parentfilectx(). And
> basefilectx.annotate() also makes similar calls, so there is potential
> for object reuse. However, introducing caches here are not appropriate
> for the stable branch.

Perhaps fctx.parents() can be property-cached, but we'll need to drop
uninteresting chains of parents in fctx.annotate().


More information about the Mercurial-devel mailing list