diff --git a/benchmarks/check_asv.sh b/benchmarks/check_asv.sh new file mode 100755 index 000000000..89a738be1 --- /dev/null +++ b/benchmarks/check_asv.sh @@ -0,0 +1,9 @@ +source env/bin/activate #or change to your env path +git pull upstream main +sudo cpufreq-set -c 3 -g performance +#asv does recent commits first, so by letting it run for 55min, and the cron to 1hr +#it will always keep up with new commits, but also process the backlog +timeout 3300s asv run -j 4 --show-stderr --cpu-affinity 3 --skip-existing ALL +sudo cpufreq-set -c 3 -g powersave +asv publish +asv preview diff --git a/benchmarks/update_asv_site.sh b/benchmarks/update_asv_site.sh deleted file mode 100755 index 2e6102870..000000000 --- a/benchmarks/update_asv_site.sh +++ /dev/null @@ -1,19 +0,0 @@ -source env/bin/activate -git pull upstream main -sudo cpufreq-set -c 3 -g performance -#asv does recent commits first, so by letting it run for 55min, and the cron to 1hr -#it will always keep up with new commits, but also process the backlog -timeout 3300s asv run -j 4 --show-stderr --cpu-affinity 3 --skip-existing ALL -sudo cpufreq-set -c 3 -g powersave -asv publish -cd .asv -rm -rf docs -mv html docs #Github doesn't let you choose arbitary subfolders to serve so we have to use docs -rm -rf .git -git init -git remote add origin git@github.com:tskit-dev/msprime-asv.git -git checkout -b main -git add * -git commit -m "Automated asv upload" -git push -f origin main -cd .. diff --git a/docs/development.md b/docs/development.md index ca8a9ec4f..320b80f30 100644 --- a/docs/development.md +++ b/docs/development.md @@ -759,13 +759,12 @@ on how to write and run these tests. Benchmarks to measure performance are in the `benchmarks` folder and are run using [airspeed velocity](https://asv.readthedocs.io/en/stable/index.html). -An automated system runs the benchmarks on each push to the main branch and uploads -the results to [this github pages site](https://tskit-dev.github.io/msprime-asv). +A system that runs the benchmarks on each push to the main branch. These benchmarks can also be run locally to compare your branch with the main branch. Your changes must be in a commit to be measured. To run the benchmarks: ``` -asv run asv run HEAD...main~1 +asv run HEAD...main~1 ``` This will run the benchmarks for the latest main branch commit and all commits on @@ -787,6 +786,9 @@ Note the following tips: development version. This can lead to confusing results! When tuning benchmarks it's better to commit often and use (e.g.) `asv run HEAD^! --show-stderr -b Hudson.time_large_sample_size`. +- You may want to benchmark a specific list of commits exclusively. To do so, put the commits' hashes in a file and use the command: `asv run --show-stderr --skip-existing HASHFILE:hashestobenchmark.txt` + +- There is a script: `benchmarks/check_asv.sh` that can be used to benchmark recent commits. ## Containerization diff --git a/requirements/development.txt b/requirements/development.txt index 3b9de8288..f4c592393 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,5 +1,5 @@ docutils==0.21.2 # issue with 0.17, https://github.com/tskit-dev/msprime/issues/1625 -asv +asv==0.6.1 bintrees coverage daiquiri