rust: itering less on MissingAncestors.bases for max()
Instead of iterating on the whole `self.bases` each time to find
its max, we keep the latter in a separate member attribute and
keep it up to date in `add_bases()`
On a perfdiscovery done on PyPy, with repos prepared with
`contrib/discovery-helper.sh 50 100`, this gives a slight
improvement (around 0.5% on wall time, but 10% on CPU)
before:
! wall 0.172801 comb 0.180000 user 0.180000 sys 0.000000 (median of 541)
after:
! wall 0.171798 comb 0.160000 user 0.160000 sys 0.000000 (median of 551)
(perf command run time upped because of bigger variability during this test).
Differential Revision: https://phab.mercurial-scm.org/D5945
rust: stop putting NULL_REVISION in MissingAncestors.bases
As noted in initial review of MissingAncestors, adding
NULL_REVISION in constructor in case the given `bases` is
empty wasn't really useful, yet it's been kept for identity
with the Python implementation
Differential Revision: https://phab.mercurial-scm.org/D5944
rust: less set lookups in MissingAncestors
using the return values of HashSet::remove(), we can factor
pairs of `contains()/remove()` into a single `remove()`.
On a perfdiscovery run done on the PyPy repository, prepared
with contrib/discovery-helper.sh 50 100, I do get a modest improvement
with this (mean of medians of three runs is better by 2%)
Sample readings, before this change:
! wall 0.175609 comb 0.180000 user 0.180000 sys 0.000000 (median of 58)
With this change:
! wall 0.171662 comb 0.180000 user 0.170000 sys 0.010000 (median of 60)
Differential Revision: https://phab.mercurial-scm.org/D5943
rust: less set lookups in AncestorsIterator
This uses the boolean return of `HashSet::insert()` to factor
pairs of contains()/insert() into a single insert()
On the mozilla-central repository (450k changesets), I get about a bit more
than 10% better medians in perfancestors (taking the mean of three runs)
Best run for parent changeset:
! wall 0.106474 comb 0.110000 user 0.110000 sys 0.000000 (median of 93)
Best run for this changeset:
! wall 0.093191 comb 0.090000 user 0.090000 sys 0.000000 (median of 100)
Differential Revision: https://phab.mercurial-scm.org/D5942
obsutil: don't assume leftctx and rightctx repo as same
Backed out changeset
520514af2d93.
hgsubversion can pass leftctx and rightctx which are instances of two different
repositories. This was making tests fail on hgsubversion with 4.9.
The two different instances are:
(Pdb) p rightctx.repo()
<filteredrepo:served <hgsubversion.svnrepo.svnlocalrepo object at 0x
7fe29d296d10>>
(Pdb) p leftctx.repo()
<filteredrepo:visible <hgsubversion.svnrepo.svnlocalrepo object at 0x
7fe29d494590>>
Differential Revision: https://phab.mercurial-scm.org/D5968
tests: add more wildcards to test-extdiff.t
The diff tool (which is `echo`) runs in the background and output
order can therefore be non-deterministic. We need to glob over
the file names to account for this.
Differential Revision: https://phab.mercurial-scm.org/D5976