From 58802f8974df27fcdac5a72c4900fc67d3fa955c Mon Sep 17 00:00:00 2001 From: Hossameldin Ali <35299548+hossam26644@users.noreply.github.com> Date: Sat, 16 Aug 2025 07:27:09 +0100 Subject: [PATCH 1/3] Fix asv build error For later asv versions (tested on 0.6.4) it fails to build the project without meaningful errors. It is suggested online to add build parameters to asv.conf.json or use version <= 0.6.1 (The second solution is simpler) --- requirements/development.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 943d511f44fa9d6f01bad7006d0b735ad49aeb2b Mon Sep 17 00:00:00 2001 From: hossam26644 Date: Wed, 27 Aug 2025 11:59:03 +0100 Subject: [PATCH 2/3] update development.md --- docs/development.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 From 4d9eb0aa10cce3a674af40e196468f581951af47 Mon Sep 17 00:00:00 2001 From: hossam26644 Date: Wed, 27 Aug 2025 12:01:20 +0100 Subject: [PATCH 3/3] Replace update_asv_site.sh with check_asv.sh as the website is no longer supported --- benchmarks/check_asv.sh | 9 +++++++++ benchmarks/update_asv_site.sh | 19 ------------------- 2 files changed, 9 insertions(+), 19 deletions(-) create mode 100755 benchmarks/check_asv.sh delete mode 100755 benchmarks/update_asv_site.sh 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 ..