diff --git a/.gitignore b/.gitignore index 491072c4c..33052203e 100644 --- a/.gitignore +++ b/.gitignore @@ -375,4 +375,6 @@ examples/*.png examples/documentation-testing.py todo.md -tools/vcpkg/ \ No newline at end of file +tools/vcpkg/ + +.asv/ diff --git a/asv.conf.json b/asv.conf.json index 43ab53bf5..125a44318 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -4,48 +4,55 @@ "project_url": "https://github.com/datasig-ac-uk/RoughPy", "repo": ".", "branches": [ - "jl/benchmarks" + "" ], "dvcs": "git", "environment_type": "virtualenv", "show_commit_url": "https://github.com/datasig-ac-uk/RoughPy/commit/", - "pythons": ["3.12"], - + "pythons": [ + "3.12" + ], "matrix": { - "jax": ["0.8.0"], - "jaxlib": ["0.8.0"], - "numpy": ["2.3.4"] + "jax": [ + "0.8.0" + ], + "jaxlib": [ + "0.8.0" + ], + "numpy": [ + "2.3.4" + ] }, - "exclude": [ - {"python": "3.12", "jax": null} + { + "python": "3.12", + "jax": null + } ], - "benchmark_dir": "benchmarks/", "env_dir": ".asv/env", "results_dir": ".asv/results", "html_dir": ".asv/html", - "install_command": [ "python -m pip install {wheel_file}" ], - "uninstall_command": [ "return-code=any python -m pip uninstall -y {project}" ], - "build_command": [ "python -m pip install scikit-build-core[pyproject] 'pybind11<3.0.0' numpy hatch-fancy-pypi-readme jax", "CMAKE_ARGS='-DROUGHPY_JAX=ON' python -m pip wheel --no-build-isolation --no-deps -vvv {build_dir} -w {build_cache_dir}" ], - "benchmark_pattern": "^(Bench|Track|Suite)", "regressions_first_commits": {}, "regressions_thresholds": { - "factors": {"factor": 2.0}, - "percentages": {"percentage": 20.0} + "factors": { + "factor": 2.0 + }, + "percentages": { + "percentage": 20.0 + } }, - "hash_length": 8, "cpu_count": null, "build_cache_size": 1 diff --git a/benchmarks/README.md b/benchmarks/README.md index 7dfba05db..e0d9a0f26 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -19,10 +19,18 @@ This installs: ### Running Benchmarks #### Initial Setup -```bash -# Navigate to benchmarks directory -cd benchmarks +Open `asv.conf.json` and set your branch name, i.e. replace with result of `git branch --show-current`: + +```json + "branches": [ + "" + ], +``` + +Then in the shell: + +```bash # Initialize ASV (first time only) asv machine --yes @@ -32,8 +40,6 @@ asv run --launch-method spawn #### Continuous Use ```bash -# From benchmarks directory: - # Run benchmarks for specific commits asv run main^..HEAD @@ -47,8 +53,6 @@ asv preview #### Development Testing ```bash -# From benchmarks directory: - # Quick test of benchmark validity asv dev