prototype-lib#

Documentation and benchmark charts: https://pattonw.github.io/prototype-lib

A throwaway package used to trial performance tracking across commits with github-action-benchmark. It has the shape of a real library (a Roi-like value type, one numpy kernel, py.typed, ruff, ty and a coverage floor) and nothing else.

Every push to main records two numbers in the tests job:

Metric

How

import prototype_lib (cold)

python -I -c "import prototype_lib" minus interpreter startup, median of 10

pytest wall time

the duration of the job’s own uv run pytest

The benchmark workflow then publishes them with github-action-benchmark: it appends them to dev/bench/data.js on the gh-pages branch, writes a comparison table to the job summary, and comments on the commit when a metric gets 1.5x worse. The docs workflow then rebuilds this site with the data copied in, so the Benchmarks page charts every commit on main. Nothing runs the tests twice.

uv sync
uv run pytest
uv run python benchmarks/run.py     # the import-time metric, locally
uv run --group docs sphinx-build -W docs/source docs/build/html   # docs

Performance

Reference