Georges Racinet <gracinet@anybox.fr> [Thu, 06 Dec 2018 20:04:35 +0100] rev 41115
rust-cpython: using the new bindings from Python
The Python callers detect if we have cpython or
direct-ffi bindings and fallback to the Python
implementation if none is present.
This intermediate state allows to compare the
three possibilities.
Differential Revision: https://phab.mercurial-scm.org/D5442
Georges Racinet <gracinet@anybox.fr> [Thu, 13 Dec 2018 18:53:40 +0100] rev 41114
rust-cpython: binding for LazyAncestors
The `mercurial.rustext.ancestor` module will not in the foreseeable
future be a drop-in replacement for the pure `mercurial.ancestor`, because the
Rust variants take the index at instantiation whereas the Python ones
take a parents function. From the Python side, using the index from `ancestor`
would leak internal details out of `mercurial.revlog`, and that's unwanted.
Therefore, given that classes defined in
`rust-cpython` have the same names in both language, we keep the Rust naming
convention (CamelCase).
Eventually, though, the ancestor module can be placed under control of
`mercurial.policy`, but it will still be up to `revlog` to be aware of
that and play the role of a factory for instantiation.
Differential Revision: https://phab.mercurial-scm.org/D5441
Boris Feld <boris.feld@octobus.net> [Fri, 28 Dec 2018 03:28:02 +0100] rev 41113
discovery: move common heads computation inside partialdiscovery object
This remove one of the private attribute access. In additions, head tracking
and computation is a typical operation we can speed up using Rust.
Boris Feld <boris.feld@octobus.net> [Fri, 28 Dec 2018 03:14:34 +0100] rev 41112
discovery: introduce a partialdiscovery object
This object will ultimately gather the data about common, undecided and
missing revs in a single place and deal with most graph related computations.
The goal is both to clarify the algorithm and to help provides a simple and
clear API that can be reimplemented in Rust.
For now, we only moved the `common` set in the object. In this commit, some
direct access to the "private" `disco._common` attribute persist. They have
not been removed yet because we won't need to expose a full API identical to
`incrementalmissingancestors` and it seems simpler to access the attribute
directly until the replacement is in place.
Boris Feld <boris.feld@octobus.net> [Fri, 14 Dec 2018 12:01:15 +0100] rev 41111
discovery: move handling of sampling special case inside sampling function
The handling of cases where the number of revisions to sample is smaller than
the sample size can be moved with the sample function themselves. This
simplifies main logic, preparing a coming refactoring.
Boris Feld <boris.feld@octobus.net> [Fri, 04 Jan 2019 17:49:59 +0100] rev 41110
discovery: minor fix to some conditionals
Since `size` is the upper limit of the sample, we should include it in the
check. Otherwize the `more` variable will be zero and the sampling will be
useless
Boris Feld <boris.feld@octobus.net> [Thu, 20 Dec 2018 10:16:24 +0100] rev 41109
delta: reuse _findsnapshot call from previous stage
Two different stage of the sparse-revlog logic needs the _findsnapshot data.
To avoid recomputing it twice, make it possible to reuse the first computation
in the second step.
example affected manifest write
before: 0.067141s
after: 0.064252s (-5%)
(total gain since start of series: 95%)
Boris Feld <boris.feld@octobus.net> [Thu, 20 Dec 2018 10:15:20 +0100] rev 41108
delta: have a native implementation of _findsnapshot
The function might traverse a lot of revision, a native implementation get
significantly faster.
example affected manifest write
before: 0.114989
after: 0.067141 (-42%)
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Dec 2018 12:39:20 +0900] rev 41107
transaction: do not overwrite atomic-temp files on error
Even though the original files can be restored from the backup, it should be
better to not write back a temporary file if we know it can be corrupted.
Ludovic Chabant <ludovic@chabant.com> [Thu, 03 Jan 2019 10:13:34 -0800] rev 41106
help: fix typo
Yuya Nishihara <yuya@tcha.org> [Tue, 18 Dec 2018 22:23:48 +0900] rev 41105
rust: use 'impl Trait' in method argument of AncestorsIterator
I just didn't know it's stabilized. Let's switch to new convenient syntax.
Differential Revision: https://phab.mercurial-scm.org/D5451
Yuya Nishihara <yuya@tcha.org> [Tue, 18 Dec 2018 22:12:16 +0900] rev 41104
rust: use .rev() for reverse range
Differential Revision: https://phab.mercurial-scm.org/D5450