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.
--- 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)