HomePhabricator

rust: less set lookups in MissingAncestors

Authored by gracinet.

Description

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

Details

Committed
gracinetFeb 4 2019, 6:04 AM
Differential Revision
D5943: rust: less set lookups in MissingAncestors
Parents
rHG70827ebba453: rust: less set lookups in AncestorsIterator
Branches
Unknown
Tags
Unknown