Add ASV performance benchmarks and GitHub Pages integration (closes #12)#48
Open
endolith wants to merge 2 commits into
Open
Add ASV performance benchmarks and GitHub Pages integration (closes #12)#48endolith wants to merge 2 commits into
endolith wants to merge 2 commits into
Conversation
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>
PR Summary
|
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_utilitiesstrategies:honest_rankings,honest_normed_scores,approval_optimal,vote_for_kmethods: ranked-ballot methods, scored ballots, approval/combined approval, Condorcet helpers,utility_winnerbenchoptional dependency —asvonly (documented viaproject.urls.Benchmarks).docs/benchmarks.rst, toctree entry,project.urlslink tohttps://endolith.github.io/elsim/benchmarks/.docs/conf.py—html_extra_pathincludesdocs/_benchmark_sitewhen present so locally built docs work without pre-running ASV.pip install .[docs,fast,bench], runsasv machine --yes,asv run master,asv publishintodocs/_benchmark_site/benchmarks, thensphinx-buildand deploy (replaces the composite action so benchmarks are generated before Sphinx).python-package.yml: on Python 3.12 +test,fast, runsasv check --python=sameafter installing[bench].Maintainer / contributor notes
benchmarks/:asv run --python=same --quickfor a fast smoke test afterpip install -e "..[fast,bench]".