HomePhabricator

linelog: optimize replacelines

Authored by quark.

Description

linelog: optimize replacelines

The optimization to avoid calling annotate inside replacelines is significant
for practical use patterns.

Before this patch:

hg perflinelogedits
! wall 6.778478 comb 6.710000 user 6.700000 sys 0.010000 (best of 3)

After this patch:

hg perflinelogedits
! wall 0.136573 comb 0.140000 user 0.130000 sys 0.010000 (best of 63)

Differential Revision: https://phab.mercurial-scm.org/D4150

Details

Committed
quarkAug 7 2018, 8:22 PM
Differential Revision
D4150: linelog: optimize replacelines
Parents
rHG32b1967b8734: linelog: extract `len(self._program)` to a local function
Branches
Unknown
Tags
Unknown