changeset 1173:8d439efb4a90

Replace hotspot by cProfile for profiling.
author Marcel Keller <mkeller@cs.au.dk>
date Fri, 24 Apr 2009 14:00:00 +0200
parents 421a199020e9
children ade6aff2dde2
files viff/runtime.py
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Wed Apr 15 11:30:07 2009 +0200
+++ b/viff/runtime.py	Fri Apr 24 14:00:00 2009 +0200
@@ -817,19 +817,15 @@
         # profiler here and stop it upon shutdown, but this triggers
         # http://bugs.python.org/issue1375 since the start and stop
         # calls are in different stack frames.
-        import hotshot
-        prof = hotshot.Profile("player-%d.prof" % id)
+        import cProfile
+        prof = cProfile.Profile()
         old_run = reactor.run
         def new_run(*args, **kwargs):
             print "Starting reactor with profiling"
             prof.runcall(old_run, *args, **kwargs)
 
-            import sys
-            import hotshot.stats
-            print "Loading profiling statistics...",
-            sys.stdout.flush()
-            stats = hotshot.stats.load("player-%d.prof" % id)
-            print "done."
+            import pstats
+            stats = pstats.Stats(prof)
             print
             stats.strip_dirs()
             stats.sort_stats("time", "calls")