Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 44513:e7fff9c3cdac
rust-nodemap: automatically use the rust index for persistent nodemap
The persistent nodemap requires the rust index to be used to provides any gains.
So we automatically enable it for revlog using the persistent nodemap. We keep
it off for other revset because now that the rust revlog fully initialise the
nodemap using it everywhere introduce a fairly significant regression (eg: hg
diff moving from 0.8s to 2.3s on mozilla-try)
Differential Revision: https://phab.mercurial-scm.org/D8164
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 18 Feb 2020 15:19:11 +0100 |
parents | 87b327de772c |
children | 6c906eaedd0d |
comparison
equal
deleted
inserted
replaced
44512:febe88a6f7f7 | 44513:e7fff9c3cdac |
---|---|
616 self.nodemap_file | 616 self.nodemap_file |
617 and opts.get(b'devel-force-nodemap', False) | 617 and opts.get(b'devel-force-nodemap', False) |
618 and NodemapRevlogIO is not None | 618 and NodemapRevlogIO is not None |
619 ) | 619 ) |
620 | 620 |
621 use_rust_index = False | |
622 if rustrevlog is not None: | |
623 if self.nodemap_file is not None: | |
624 use_rust_index = True | |
625 else: | |
626 use_rust_index = self.opener.options.get(b'rust.index') | |
627 | |
621 self._io = revlogio() | 628 self._io = revlogio() |
622 if self.version == REVLOGV0: | 629 if self.version == REVLOGV0: |
623 self._io = revlogoldio() | 630 self._io = revlogoldio() |
624 elif devel_nodemap: | 631 elif devel_nodemap: |
625 self._io = NodemapRevlogIO() | 632 self._io = NodemapRevlogIO() |
626 elif rustrevlog is not None and self.opener.options.get(b'rust.index'): | 633 elif use_rust_index: |
627 self._io = rustrevlogio() | 634 self._io = rustrevlogio() |
628 try: | 635 try: |
629 d = self._io.parseindex(indexdata, self._inline) | 636 d = self._io.parseindex(indexdata, self._inline) |
630 index, _chunkcache = d | 637 index, _chunkcache = d |
631 use_nodemap = ( | 638 use_nodemap = ( |