Mercurial > hg
comparison mercurial/revlogutils/nodemap.py @ 44310:daad3aace942
nodemap: only use persistent nodemap for non-inlined revlog
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.
Differential Revision: https://phab.mercurial-scm.org/D7837
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Jan 2020 15:47:40 +0100 |
parents | 6c07480d6659 |
children | 2b72c4ff8ed1 |
comparison
equal
deleted
inserted
replaced
44309:6c07480d6659 | 44310:daad3aace942 |
---|---|
32 def setup_persistent_nodemap(tr, revlog): | 32 def setup_persistent_nodemap(tr, revlog): |
33 """Install whatever is needed transaction side to persist a nodemap on disk | 33 """Install whatever is needed transaction side to persist a nodemap on disk |
34 | 34 |
35 (only actually persist the nodemap if this is relevant for this revlog) | 35 (only actually persist the nodemap if this is relevant for this revlog) |
36 """ | 36 """ |
37 if revlog._inline: | |
38 return # inlined revlog are too small for this to be relevant | |
37 if revlog.nodemap_file is None: | 39 if revlog.nodemap_file is None: |
38 return # we do not use persistent_nodemap on this revlog | 40 return # we do not use persistent_nodemap on this revlog |
39 callback_id = b"revlog-persistent-nodemap-%s" % revlog.nodemap_file | 41 callback_id = b"revlog-persistent-nodemap-%s" % revlog.nodemap_file |
40 if tr.hasfinalize(callback_id): | 42 if tr.hasfinalize(callback_id): |
41 return # no need to register again | 43 return # no need to register again |