beast icon indicating copy to clipboard operation
beast copied to clipboard

Profiling phat_small example

Open jwuphysics opened this issue 5 years ago • 3 comments

I decided to profile (cProfile) the phat_small example using snakeviz (which is pip-installable). This is so that we can see which commands are running suboptimally.

# run profiler and save output to `phat_small.prof`
python -m cProfile -o phat_small.prof run_beast.py -potf

# launch server that displays results
snakeviz phat_small.prof

This displays something like: phat-small_overall-profile

We can focus on only the run_fitting method, which should be called multiple times in the production runs: run_fitting

It also outputs the longest calls (per call): phat-small_profile-percall

Eventually this might be useful for optimizing specific functions.

jwuphysics avatar Jan 17 '20 22:01 jwuphysics