Becksteinlab / kda

Python package used for the analysis of biochemical kinetic diagrams.
GNU General Public License v3.0
3 stars 1 forks source link

Add airspeed velocity benchmarks #109

Closed nawtrey closed 2 months ago

nawtrey commented 2 months ago

Changes

Description

As discussed in #108, we are adding some benchmarks for easy performance comparison between commits.

To run the benchmarks locally, simply run asv run from the kda/benchmarks directory. Running on this commit gave me the following results:

Output for local run ``` $ asv run Couldn't load asv.plugins._mamba_helpers because No module named 'conda' ▒ Creating environments ▒ Discovering benchmarks ▒▒ Uninstalling from conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy ▒▒ Building 254155f8 for conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy ▒▒ Installing 254155f8 into conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy ▒ Running 10 total benchmarks (1 commits * 1 environments * 10 benchmarks) [ 0.00%] ▒ For kda commit 254155f8 : [ 0.00%] ▒▒ Benchmarking conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy [10.00%] ▒▒▒ Running (bench_calculations.Sigma.time_calc_sigma--).. [30.00%] ▒▒▒ Running (bench_diagrams.DirectionalDiagrams.time_generate_directional_diagrams--)... [55.00%] ▒▒▒ bench_calculations.Sigma.peakmem_calc_sigma ok [55.00%] ▒▒▒ ============== ======= ======= -- output_strings -------------- --------------- graph True False ============== ======= ======= 3-state 70.4M 70.3M Hill-5-state 70.4M 70M Hill-8-state 70.7M 70.9M EmrE-8-state 73.3M 73.4M ============== ======= ======= [60.00%] ▒▒▒ bench_calculations.Sigma.time_calc_sigma ok [60.00%] ▒▒▒ ============== ============ ============ -- output_strings -------------- ------------------------- graph True False ============== ============ ============ 3-state 73.6~20us 58.7~8us Hill-5-state 531~200us 552~100us Hill-8-state 6.68▒0.7ms 6.41▒0.3ms EmrE-8-state 40.8▒1ms 50.7▒10ms ============== ============ ============ [65.00%] ▒▒▒ ...ulations.StateProbs.peakmem_calc_state_probs ok [65.00%] ▒▒▒ ============== ======= ======= -- output_strings -------------- --------------- graph True False ============== ======= ======= 3-state 72.3M 70.5M Hill-5-state 72.4M 70.6M Hill-8-state 75M 71M EmrE-8-state 81M 73.3M ============== ======= ======= [70.00%] ▒▒▒ ...alculations.StateProbs.time_calc_state_probs ok [70.00%] ▒▒▒ ============== ============ ============ -- output_strings -------------- ------------------------- graph True False ============== ============ ============ 3-state 3.60▒0.9ms 1.43▒0.2ms Hill-5-state 14.9▒1ms 6.87▒0.4ms Hill-8-state 653▒40ms 63.3▒9ms EmrE-8-state 11.0▒0.1s 418▒20ms ============== ============ ============ [75.00%] ▒▒▒ ...agrams.peakmem_generate_directional_diagrams ok [75.00%] ▒▒▒ ============== ======= ======= -- return_edges -------------- --------------- graph True False ============== ======= ======= 3-state 70.2M 70.3M Hill-5-state 70.4M 70.8M Hill-8-state 70.8M 76.2M EmrE-8-state 73.4M 109M ============== ======= ======= [80.00%] ▒▒▒ ...lDiagrams.time_generate_directional_diagrams ok [80.00%] ▒▒▒ ============== ============= ============= -- return_edges -------------- --------------------------- graph True False ============== ============= ============= 3-state 1.17▒0.01ms 1.52▒0.01ms Hill-5-state 6.29▒0.1ms 9.05▒0.05ms Hill-8-state 53.6▒0.5ms 89.2▒3ms EmrE-8-state 388▒30ms 684▒50ms ============== ============= ============= [85.00%] ▒▒▒ ....FluxDiagrams.peakmem_generate_flux_diagrams ok [85.00%] ▒▒▒ ============== ======= graph -------------- ------- 3-state 70.6M Hill-5-state 70.8M Hill-8-state 71.3M EmrE-8-state 76.5M ============== ======= [90.00%] ▒▒▒ ...ams.FluxDiagrams.time_generate_flux_diagrams ok [90.00%] ▒▒▒ ============== ============ graph -------------- ------------ 3-state 859~20us Hill-5-state 2.64▒0.6ms Hill-8-state 24.7▒4ms EmrE-8-state 157▒1ms ============== ============ [95.00%] ▒▒▒ ...alDiagrams.peakmem_generate_partial_diagrams ok [95.00%] ▒▒▒ ============== ======= ======= -- return_edges -------------- --------------- graph True False ============== ======= ======= 3-state 70.2M 70.3M Hill-5-state 70.2M 70.4M Hill-8-state 70.5M 70.8M EmrE-8-state 70.3M 73M ============== ======= ======= [100.00%] ▒▒▒ ...rtialDiagrams.time_generate_partial_diagrams ok [100.00%] ▒▒▒ ============== ============ ============= -- return_edges -------------- -------------------------- graph True False ============== ============ ============= 3-state 246~8us 234~7us Hill-5-state 494~7us 469~2us Hill-8-state 3.00▒0.2ms 2.77▒0.06ms EmrE-8-state 17.7▒0.1ms 17.9▒2ms ============== ============ ============= ```

The 10 benchmarks are parameterized over different graphs starting from the simple 3-state model to the 8-state EmrE model to give a reasonable range for comparison.

nawtrey commented 2 months ago

Alright, I think this is a healthy starting point for benchmarking KDA functions and all benchmarks are working as intended locally. Merging.