http://hg.viff.dk/viff/rev/8d439efb4a90
changeset: 1173:8d439efb4a90
user:      Marcel Keller <[email protected]>
date:      Fri Apr 24 14:00:00 2009 +0200
summary:   Replace hotspot by cProfile for profiling.

diffstat:

1 file changed, 4 insertions(+), 8 deletions(-)
viff/runtime.py |   12 ++++--------

diffs (27 lines):

diff -r 421a199020e9 -r 8d439efb4a90 viff/runtime.py
--- 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")
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk

Reply via email to