comparison mercurial/revset.py @ 25567:f140d6207cca

revset: use parentsets.min in _children As stated in the comment, using the smartset 'min' will give more opportunity to be smart. It give a small but significant boost to the performance. Most of the time is still spend doing the actual computation but at least we can scrap some performance when it makes sense. revset #0: roots(0:tip) plain 0) 0.046600 1) 0.044109 94%
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 11 Jun 2015 19:02:24 -0700
parents 15412bba5a68
children 97528adbf74b
comparison
equal deleted inserted replaced
25566:15412bba5a68 25567:f140d6207cca
620 def _children(repo, narrow, parentset): 620 def _children(repo, narrow, parentset):
621 if not parentset: 621 if not parentset:
622 return baseset() 622 return baseset()
623 cs = set() 623 cs = set()
624 pr = repo.changelog.parentrevs 624 pr = repo.changelog.parentrevs
625 # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset 625 minrev = parentset.min()
626 # (and if it is not, it should.)
627 minrev = min(parentset)
628 for r in narrow: 626 for r in narrow:
629 if r <= minrev: 627 if r <= minrev:
630 continue 628 continue
631 for p in pr(r): 629 for p in pr(r):
632 if p in parentset: 630 if p in parentset: