changeset 38255:71d59b487d0c

perftemplating: drop usage of buffer The buffer can consume a lot of memory and change various internal behaviors. Writing to dev/null seems more appropriate when it comes to benchmark.
author Boris Feld <boris.feld@octobus.net>
date Thu, 31 May 2018 18:43:15 +0200
parents 6b91815fcdce
children b8f75bc9f623
files contrib/perf.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Thu May 31 17:31:46 2018 +0200
+++ b/contrib/perf.py	Thu May 31 18:43:15 2018 +0200
@@ -899,15 +899,17 @@
 
 @command('perftemplating', formatteropts)
 def perftemplating(ui, repo, *revs, **opts):
+    nullui = ui.copy()
+    nullui.fout = open(os.devnull, 'wb')
+    nullui.disablepager()
+
     def format():
-        commands.log(ui, repo, rev=revs, date='', user='',
+        commands.log(nullui, repo, rev=revs, date='', user='',
                      template='{date|shortdate} [{rev}:{node|short}]'
                               ' {author|person}: {desc|firstline}\n')
 
     timer, fm = gettimer(ui, opts)
-    ui.pushbuffer()
     timer(format)
-    ui.popbuffer()
     fm.end()
 
 @command('perfcca', formatteropts)