[PATCH STABLE] commit: increase perf by avoiding unnecessary filteredrevs check

Matt Mackall mpm at selenic.com
Mon Nov 19 16:12:45 CST 2012


On Fri, 2012-11-16 at 15:40 -0800, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1353109152 28800
> # Node ID 270338011eff9c88433e9cced0ba4a1c424b3d4a
> # Parent  adca8ebf288c9ed00166298f3be192747d889b82
> commit: increase perf by avoiding unnecessary filteredrevs check

FYI, this is probably at the limit of what I think belongs on stable.

Every code change to stable introduces some risk of new bugs (aka
'instability'). To be worth that risk, each change ought to aim to
monotonically increase correctness with a bare minimum of change.

So in general, we don't accept even "obviously harmless" cleanups on
stable - they just have to wait three months for the next release.

This particular code is in a bit of a gray area. Fixing a 1% performance
regression would almost certainly not be accepted here, while a 100%
regression might be, depending on the importance of the workload.

> When commiting to a repo with lots of history (>400000 changesets)
> the filteredrevs check (added with 5c89e7fa5bc2) in changelog.py
> takes a bit of time even if the filteredrevs set is empty. Skipping
> the check in that case shaves 0.36 seconds off a 2.14 second commit.
> A 17% gain.

> +        if len(self.filteredrevs) == 0:
> +            return revlog.revlog.__iter__(self)

Not the ideal way to handle inheritance.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list