Skip to content

Add ASV performance benchmarks and GitHub Pages integration (closes #12)#48

Open
endolith wants to merge 2 commits into
masterfrom
cursor/asv-benchmarks-aa31
Open

Add ASV performance benchmarks and GitHub Pages integration (closes #12)#48
endolith wants to merge 2 commits into
masterfrom
cursor/asv-benchmarks-aa31

Conversation

@endolith
Copy link
Copy Markdown
Owner

Summary

Implements issue #12 using Airspeed Velocity (ASV)—the same ecosystem SciPy uses (scipy-bench); there is no widely adopted “successor” that replaces ASV for library microbenchmarks over Git history.

What was added

  • benchmarks/asv.conf.json (virtualenv, Python 3.12, editable install with [fast] so Numba paths are measured), plus benchmark modules aligned with the public API:
    • elections: random_utilities, impartial_culture, normal_electorate, normed_dist_utilities
    • strategies: honest_rankings, honest_normed_scores, approval_optimal, vote_for_k
    • methods: ranked-ballot methods, scored ballots, approval/combined approval, Condorcet helpers, utility_winner
  • bench optional dependencyasv only (documented via project.urls.Benchmarks).
  • Docsdocs/benchmarks.rst, toctree entry, project.urls link to https://endolith.github.io/elsim/benchmarks/.
  • docs/conf.pyhtml_extra_path includes docs/_benchmark_site when present so locally built docs work without pre-running ASV.
  • CI
    • Pages workflow: after pip install .[docs,fast,bench], runs asv machine --yes, asv run master, asv publish into docs/_benchmark_site/benchmarks, then sphinx-build and deploy (replaces the composite action so benchmarks are generated before Sphinx).
    • python-package.yml: on Python 3.12 + test,fast, runs asv check --python=same after installing [bench].

Maintainer / contributor notes

  • Run from benchmarks/: asv run --python=same --quick for a fast smoke test after pip install -e "..[fast,bench]".
  • Full ASV uses isolated envs and may take longer on first run (wheel build).
Open in Web Open in Cursor 

Use Airspeed Velocity (issue #12): benchmark suites for elections,
strategies, and methods mirror the public API. Docs workflow runs asv
run before sphinx-build and copies HTML into docs/_benchmark_site;
optional bench extra and asv check on CI keep the suite valid.

Co-authored-by: endolith <endolith@gmail.com>
@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented May 11, 2026

PR Summary

  • Addition of Benchmark Verification: A new task has been included in one of our workflow processes that will test our code suite efficiency using the most recent Python version. This is aimed at ensuring that our code functions optimally under this Python version.
  • Enhancement of Documentation Deployment: Our method of publishing documentation has been made more thorough. It now includes steps to install the necessary elements, run efficiency tests, and publish the results in a specific section of the documentation.
  • Update to Version Control Ignoring System: We've updated our version control system to ignore specific directories related to the new benchmarking environment and results, to help maintain clarity and cleanliness in our version control.
  • Addition of a Benchmark Configuration File: A new setup file has been devised for running efficiency tests. This file includes project details and specific rules for conducting these tests.
  • Development of Benchmark Suites: We've developed several new code files, each containing performance analyses for different methods and strategies. These analyses help us identify areas of improvement.
  • Creation of Benchmarking Documentation: A new document explaining the process and results of our efficiency tests has been added to help you understand these processes in detail.
  • Documentation Configuration Modifications: The settings of our documentation have been updated to incorporate directories for HTML files generated during the efficiency tests.
  • Main Documentation Index alterations: We have updated the main content map for our documentation to include reference to newly added efficiency tests' reports.
  • pyproject.toml updates: We have adjusted our project settings to include the new requirements for efficiency tests, as well as a new URL for the performance test section in our project information.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.15%. Comparing base (8a7213f) to head (023225a).

Files with missing lines Patch % Lines
docs/conf.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   96.31%   96.15%   -0.17%     
==========================================
  Files          19       19              
  Lines         489      494       +5     
==========================================
+ Hits          471      475       +4     
- Misses         18       19       +1     
Flag Coverage Δ
no-numba 95.34% <85.71%> (-0.16%) ⬇️
numba 89.06% <85.71%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… paths

Move os/shutil imports to top of docs/conf.py (E402). Exclude benchmarks/
from pytest coverage; scope Codecov status to elsim/ and tests/ and ignore
benchmarks/. Invoke Sphinx via python -m sphinx.cmd.build in workflows.
Run ASV check only on the 3.12 + Numba matrix row (extras != test).

Co-authored-by: endolith <endolith@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants