beast
beast copied to clipboard
Profiling phat_small example
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:
We can focus on only the run_fitting
method, which should be called multiple times in the production runs:
It also outputs the longest calls (per call):
Eventually this might be useful for optimizing specific functions.