mercurial/ui.py
changeset 41063 6603de284b0a
parent 40994 ab92e2111408
child 41076 8ecb17b7f432
--- a/mercurial/ui.py	Sun Dec 23 22:57:03 2018 -0500
+++ b/mercurial/ui.py	Mon Dec 10 20:06:58 2018 +0000
@@ -1702,6 +1702,14 @@
         elif self._progbar is not None:
             self._progbar.progress(topic, pos, item=item, unit=unit,
                                    total=total)
+
+            # Looking up progress.debug in tight loops is expensive. The value
+            # is cached on the progbar object and we can avoid the lookup in
+            # the common case where a progbar is active.
+            if pos is None or not self._progbar.debug:
+                return
+
+        # Keep this logic in sync with above.
         if pos is None or not self.configbool('progress', 'debug'):
             return