From 5a0ef7355e6329cbf20ef9c6bf7e1cd305899fe1 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 15 Oct 2010 16:36:25 +0200 Subject: [PATCH] adding a small bench script to see where time is spend in the hook architecture --HG-- branch : trunk --- bench/bench.py | 9 +++++++++ bench/empty.py | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 bench/bench.py create mode 100644 bench/empty.py diff --git a/bench/bench.py b/bench/bench.py new file mode 100644 index 000000000..b38251a15 --- /dev/null +++ b/bench/bench.py @@ -0,0 +1,9 @@ + +import cProfile +import py +import pstats +stats = cProfile.run('py.test.cmdline.main(["empty.py"])', 'prof') +p = pstats.Stats("prof") +p.strip_dirs() +p.sort_stats('cumulative') +print p.print_stats(30) diff --git a/bench/empty.py b/bench/empty.py new file mode 100644 index 000000000..c9e2e6b5f --- /dev/null +++ b/bench/empty.py @@ -0,0 +1,3 @@ + +for i in range(1000): + exec "def test_func_%d(): pass" % i