Bug 1368057 - Clear terminal footer to end of line, not screen; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Thu, 01 Jun 2017 12:40:56 -0700
changeset 587852 00d1c979fe352a91da3adb57b883b58d03d053ee
parent 587839 0e9853e31da9848ab638bdd0df4eb734a5ebc232
child 631379 e7a190cc9fd0eecf70b51bcf8319e1b1a35e57e1
push id61824
push usergszorc@mozilla.com
push dateThu, 01 Jun 2017 19:41:08 +0000
reviewersglandium
bugs1368057
milestone55.0a1
Bug 1368057 - Clear terminal footer to end of line, not screen; r?glandium bz reported that mach output was slow under xterm on Mac. He tracked this down to the terminal footer clearing until end of screen. It's likely this is triggering a vsync or repaint or something, as he measured each line to take 16ms to display. Changing the clearing operation from "end of screen" to "end of line" should be a cheaper operation and should speed up terminal writing. This code has been historically sensitive to change. There's a non-insignificant risk this will break a terminal configuration. I've tested this with PuTTY, terminal.app on OS X (including under screen), and iTerm2.app and it seems to "just work." MozReview-Commit-ID: C2sYYboksj1
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -139,17 +139,17 @@ class BuildProgressFooter(object):
         # terminal is a blessings.Terminal.
         self._t = terminal
         self._fh = sys.stdout
         self.tiers = monitor.tiers.tier_status.viewitems()
 
     def clear(self):
         """Removes the footer from the current terminal."""
         self._fh.write(self._t.move_x(0))
-        self._fh.write(self._t.clear_eos())
+        self._fh.write(self._t.clear_eol())
 
     def draw(self):
         """Draws this footer in the terminal."""
 
         if not self.tiers:
             return
 
         # The drawn terminal looks something like: