[Checkins] SVN: z3c.pt/trunk/benchmark/benchmark/bigtable.py Use cProfile from Python 2.5 instead of hotshot. We get better introspection into the template code itself
Hanno Schlichting
plone at hannosch.info
Tue Mar 31 12:08:29 EDT 2009
Log message for revision 98686:
Use cProfile from Python 2.5 instead of hotshot. We get better introspection into the template code itself
Changed:
U z3c.pt/trunk/benchmark/benchmark/bigtable.py
-=-
Modified: z3c.pt/trunk/benchmark/benchmark/bigtable.py
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/bigtable.py 2009-03-31 16:03:30 UTC (rev 98685)
+++ z3c.pt/trunk/benchmark/benchmark/bigtable.py 2009-03-31 16:08:28 UTC (rev 98686)
@@ -70,12 +70,14 @@
which = None
if '-p' in sys.argv:
which = True
- import hotshot, hotshot.stats
- prof = hotshot.Profile("template.prof")
+ from cProfile import Profile
+ import pstats
+ profiler = Profile()
setup()
test_z3c()
- benchtime = prof.runcall(test_z3c)
- stats = hotshot.stats.load("template.prof")
+ profiler.runcall(test_z3c)
+ profiler.dump_stats('template.prof')
+ stats = pstats.Stats(profiler)
stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats()
More information about the Checkins
mailing list