From a04cc3a97b11e4d3a3acc72894abd98999f033fd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Oct 2016 11:02:35 +0530 Subject: [PATCH] Limit the number of functions displayed by --profile --- kitty/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kitty/main.py b/kitty/main.py index 3f96fc890..b94045105 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -126,11 +126,16 @@ def main(): w.show() if args.profile: import cProfile + import pstats pr = cProfile.Profile() pr.enable() ret = run_app() - pr.print_stats('tottime') pr.disable() + pr.create_stats() + s = pstats.Stats(pr) + s.strip_dirs() + s.sort_stats('time', 'name') + s.print_stats(30) else: ret = run_app() app.installEventFilter(None)