[PATCH] branchmap: check node against nodemap instead of changelog (for perf)

Yuya Nishihara yuya at tcha.org
Sat Mar 5 04:40:03 EST 2016


On Thu, 3 Mar 2016 15:52:59 -0800, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1457032193 28800
> #      Thu Mar 03 11:09:53 2016 -0800
> # Node ID 37770ef41a955e687b481e955c251e7cd0386c27
> # Parent  549ff28a345f595cad7e06fb08c2ac6973e2f030
> branchmap: check node against nodemap instead of changelog (for perf)
> 
> Testing 'node in repo' requires constructing a changectx, which is a little
> expensive.  Testing 'node in repo.changelog.nodemap' is notably faster. This
> saves 10-20ms off of every command, when testing a few thousand nodes from the
> branch cache.

changelog.nodemap bypasses the filtering. If the construction of changectx is
costly, changelog.hasnode() could be used.


More information about the Mercurial-devel mailing list