--- a/mercurial/dispatch.py Thu Mar 15 15:58:55 2012 -0500
+++ b/mercurial/dispatch.py Thu Mar 15 15:59:26 2012 -0500
@@ -694,6 +694,8 @@
if options['profile']:
format = ui.config('profiling', 'format', default='text')
+ field = ui.config('profiling', 'sort', default='inlinetime')
+ climit = ui.configint('profiling', 'nested', default=5)
if not format in ['text', 'kcachegrind']:
ui.warn(_("unrecognized profiling format '%s'"
@@ -728,8 +730,8 @@
else:
# format == 'text'
stats = lsprof.Stats(p.getstats())
- stats.sort()
- stats.pprint(top=10, file=ostream, climit=5)
+ stats.sort(field)
+ stats.pprint(limit=30, file=ostream, climit=climit)
if output:
ostream.close()
--- a/mercurial/lsprof.py Thu Mar 15 15:58:55 2012 -0500
+++ b/mercurial/lsprof.py Thu Mar 15 15:59:26 2012 -0500
@@ -48,7 +48,7 @@
if limit is not None and count == limit:
return
ccount = 0
- if e.calls:
+ if climit and e.calls:
for se in e.calls:
file.write(cols % ("+%s" % se.callcount, se.reccallcount,
se.totaltime, se.inlinetime,