Edgewall Software

Ignore:
Timestamp:
Mar 9, 2009, 5:14:43 PM (15 years ago)
Author:
cmlenz
Message:

Switch profiling in the benchmarks to cProfile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/bench/bigtable.py

    r706 r1017  
    220220
    221221    if '-p' in sys.argv:
    222         import hotshot, hotshot.stats
    223         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)
    226226        stats.strip_dirs()
    227227        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()
    229232    else:
    230233        run(which)
Note: See TracChangeset for help on using the changeset viewer.