D1938: ui: Improve ui.write performance when not coloring on Windows

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Thu Jan 25 15:16:59 EST 2018


joerg.sonnenberger added inline comments.

INLINE COMMENTS

> cmdutil.py:1627
> +        args = [iter(iterable)] * n
> +        return izip_longest(*args, fillvalue=('', ''))
> +

The grouping is necessary to avoid computing the full diff in memory with the associated memory use. Turns out splitting it up is even slightly faster, too. The grouper function itself is pretty generic (modulo the hard-coded fillvalue), so putting it in util.py or so would be a good idea.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1938

To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list