changeset 35889:e49c39ffeac2

ui: improve performance for multi-component writes It is more efficient to pass down one large string to the output streams than many small ones. For a ``hg diff`` test case, it improves time from 2m26s to 2m8s. Differential Revision: https://phab.mercurial-scm.org/D1939
author Joerg Sonnenberger <joerg@bec.de>
date Thu, 25 Jan 2018 20:00:58 +0100
parents c8e2d6ed1f9e
children 44bc37d20271
files mercurial/ui.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Sun Jan 21 13:03:03 2018 +0900
+++ b/mercurial/ui.py	Thu Jan 25 20:00:58 2018 +0100
@@ -916,8 +916,7 @@
         # opencode timeblockedsection because this is a critical path
         starttime = util.timer()
         try:
-            for a in msgs:
-                self.fout.write(a)
+            self.fout.write(''.join(msgs))
         except IOError as err:
             raise error.StdioError(err)
         finally: