mailr15102 - /branches/frame_order_testing/relax.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 16, 2011 - 15:32:
Author: bugman
Date: Fri Dec 16 15:32:33 2011
New Revision: 15102

URL: http://svn.gna.org/viewcvs/relax?rev=15102&view=rev
Log:
Enabled the cProfile module when available to massively speed up the 
profiling.


Modified:
    branches/frame_order_testing/relax.py

Modified: branches/frame_order_testing/relax.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/relax.py?rev=15102&r1=15101&r2=15102&view=diff
==============================================================================
--- branches/frame_order_testing/relax.py (original)
+++ branches/frame_order_testing/relax.py Fri Dec 16 15:32:33 2011
@@ -42,7 +42,9 @@
 # Python modules.
 from optparse import Option, OptionParser
 from os import F_OK, access, getpid, putenv
-if dep_check.profile_module:
+if dep_check.cprofile_module:
+    import cProfile as profile
+elif dep_check.profile_module:
     import profile
 import pstats
 from re import match
@@ -102,7 +104,7 @@
     # relax in profiling mode.
     else:
         def print_stats(stats, status=0):
-            pstats.Stats(stats).sort_stats('cumulative', 
'name').print_stats()
+            pstats.Stats(stats).sort_stats('time', 'name').print_stats()
 
         # No profile module.
         if not dep_check.profile_module:




Related Messages


Powered by MHonArc, Updated Mon Dec 19 15:20:02 2011