mirror of https://github.com/Textualize/rich.git
85c041999c | ||
---|---|---|
.. | ||
results | ||
README.md | ||
__init__.py | ||
benchmarks.py | ||
snippets.py |
README.md
Benchmarking Rich
This directory contains benchmarks, for monitoring the performance of Rich over time.
View the benchmark dashboard here.
The benchmarks use a tool called Airspeed Velocity (asv
),
and we've configured it in asv.conf.json.
Running Benchmarks
We strongly recommend running asv run --help
for a full list of options, but
here are some common actions:
- You can run the benchmarks against the
master
branch withasv run
. - To test the most recent commit on your branch
asv run HEAD^!
. - To generate a static website for browsing the results, run
asv publish
. The resulting HTML can be found inbenchmarks/html
.
The asv docs have some more examples here.
Updating the Benchmark Website
- Ensure any tags you wish to benchmark are included in the file
asvhashfile
at the root of the repo. - Run the benchmarks for those tags by running
asv run HASHFILE:asvhashfile
. This will take several minutes. - Create the HTML locally for those benchmarks by running
asv publish
. - Run
asv preview
to launch a local webserver that will let you preview the benchmarks dashboard. Navigate to the URL this command gives you and check everything looks fine. - Checkout the
rich-benchmarks
repo from here andcd
into it. - Copy the HTML you generated earlier into the root of this repo, e.g.
cp -r ../rich/benchmarks/html/* .
(assuming you checked outrich-benchmarks
alongsiderich
in your filesystem) - When the HTML is merged into
main
, the benchmark dashboard will be updated automatically via a GitHub Action.