ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.22k stars 115 forks source link

Add an option to store profiling information #259

Open tebeka opened 2 months ago

tebeka commented 2 months ago

In some cases I'd like to investigate the profiling information after the benchmark, maybe with snakeviz.

I suggest adding --benchmark-cprofile-save=FILE that will save the cProfile information (pstats) to FILE.

If this flag is specific, it implies that ---benchmark-cprofile is set as well. Maybe with cumtime if not explictly specified.