Patchwork D7837: nodemap: only use persistent nodemap for non-inlined revlog

login
register
mail settings
Submitter phabricator
Date Jan. 11, 2020, 5:04 p.m.
Message ID <differential-rev-PHID-DREV-yjqgcfqit3sybnknmvqn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44260/
State New
Headers show

Comments

phabricator - Jan. 11, 2020, 5:04 p.m.
marmoute created this revision.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Revlog are inlined while they are small (to avoid having too many file to deal
  with). The persistent nodemap will only provides a significant boost for large
  enough revlog index. So it does not make sens to add an extra file to store
  nodemap for small revlog.
  
  We could consider inclining the nodemap data inside the revlog itself, but the
  benefit is unclear so let it be an adventure for another time.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7837

AFFECTED FILES
  mercurial/revlog.py
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -29,6 +29,8 @@ 
 
 
 def setup_persistent_nodemap(tr, revlog):
+    if revlog._inline:
+        return  # inlined revlog are too small for this to be relevant
     if revlog.nodemap_file is None:
         return  # we do not use persistent_nodemap on this revlog
     callback_id = b"revlog-persistent-nodemap-%s" % revlog.nodemap_file
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1965,6 +1965,7 @@ 
             # manager
 
         tr.replace(self.indexfile, trindex * self._io.size)
+        nodemaputil.setup_persistent_nodemap(tr, self)
         self._chunkclear()
 
     def _nodeduplicatecallback(self, transaction, node):