Changeset 1017
- Timestamp:
- Mar 9, 2009, 5:14:43 PM (15 years ago)
- Location:
- trunk/examples/bench
- Files:
-
- 2 edited
-
basic.py (modified) (1 diff)
-
bigtable.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/bench/basic.py
r768 r1017 191 191 192 192 if '-p' in sys.argv: 193 import hotshot, hotshot.stats194 prof = hotshot.Profile("template.prof")195 benchtime = prof.runcall(run, engines, number=100, verbose=verbose)196 stats = hotshot.stats.load("template.prof")193 import cProfile, pstats 194 prof = cProfile.Profile() 195 prof.run('run(%r, number=200, verbose=%r)' % (engines, verbose)) 196 stats = pstats.Stats(prof) 197 197 stats.strip_dirs() 198 stats.sort_stats('time', 'calls') 199 stats.print_stats(.05) 198 stats.sort_stats('calls') 199 stats.print_stats(25) 200 if verbose: 201 stats.print_callees() 202 stats.print_callers() 200 203 else: 201 204 run(engines, verbose=verbose) -
trunk/examples/bench/bigtable.py
r706 r1017 220 220 221 221 if '-p' in sys.argv: 222 import hotshot, hotshot.stats223 prof = hotshot.Profile("template.prof")224 benchtime = prof.runcall(run, which, number=1)225 stats = hotshot.stats.load("template.prof")222 import cProfile, pstats 223 prof = cProfile.Profile() 224 prof.run('run(%r, number=1)' % which) 225 stats = pstats.Stats(prof) 226 226 stats.strip_dirs() 227 227 stats.sort_stats('time', 'calls') 228 stats.print_stats() 228 stats.print_stats(25) 229 if '-v' in sys.argv: 230 stats.print_callees() 231 stats.print_callers() 229 232 else: 230 233 run(which)
Note: See TracChangeset
for help on using the changeset viewer.
