Mercurial > hg
diff contrib/simplemerge @ 35779:eefabd9ed3e1
convert: use a collections.deque
This function was doing a list.pop(0) on a list whose length
was the number of revisions to convert. Popping an early element
from long lists is not an efficient operation.
collections.deque supports efficient inserts and pops at both
ends. So we switch to that data structure.
When converting the mozilla-unified repository, which has 445,748
revisions, this change makes the "sorting..." step of
`hg convert --sourcesort` significantly faster:
before: ~59.2s
after: ~1.3s
Differential Revision: https://phab.mercurial-scm.org/D1934
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 21 Jan 2018 17:11:31 -0800 |
parents | d2fc88426d21 |
children | a8a902d7176e |