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: