Benchmarking¶
Prepare the Environment¶
Assuming you have forked the repository and cloned it locally.
Use cd JAnim to enter the project folder, then install the environment with dependencies required for benchmarking:
pip install -e .[bench]
Run Benchmarks¶
The project provides a convenient script entry point to run benchmarks. The command format is:
python scripts bench [options]
Examples of available options:
--untested_tags: test all untested tags since v2.1.0.--tags <tag> [<tag> ...]: run tests for one or more tags, for example--tags v2.1.0 v2.2.0.--hashes <hash> [<hash> ...]: run tests by commit hash (multiple values allowed).-o/--open: automatically open the preview in the browser.
Usage Examples¶
Test all untested tags (after v2.1.0):
python scripts bench --untested_tags
Test specified tags:
python scripts bench --tags v2.1.0 v2.2.0
Test with specified hashes and automatically open the preview:
python scripts bench --hashes 78b7c20 2c1fcfd -o
You can also directly use
asv preview -bto preview published results locally.
Script Behavior¶
When
--untested_tagsis used, the script queries hashes for tags since v2.1.0 in the repository (the internal implementation is inscripts/bench/hashes.py), compares them against already tested hashes, and runs benchmarks only for untested commits.If
--tagsor--hashesare also provided, they will be added to the hash list to be tested as well.Before execution starts, the script writes the hash list to be tested into
.asv/_tag_hashes.txt, runs benchmark cases viaasv run HASHFILE:.asv/_tag_hashes.txt, then publishes results locally withasv publish, and finally (optionally) opens a browser preview withasv preview -b.