Bug 1368057 - Clear terminal footer to end of line, not screen; r=glandium
authorGregory Szorc <gps@mozilla.com>
Thu, 01 Jun 2017 12:40:56 -0700
changeset 410203 8fe7c30a22028584204bc88fe7c2bd277c0a43a2
parent 410202 372bdca82f66d8dc63f66890248fc6935c19e4ce
child 410204 d62f2d63e674eb78ba995bec230c3c0a3b8d7c19
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1368057
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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: