diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 19e9a25..77880d6 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -22,7 +22,11 @@ jobs: fail-fast: false matrix: python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"] + # run the suite against both the default renderer and the opt-in fast + # one (REACTON_FAST=1), so both stay green + reacton-fast: ["0", "1"] + name: unit-test (py${{ matrix.python-version }}, REACTON_FAST=${{ matrix.reacton-fast }}) steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -37,4 +41,6 @@ jobs: run: | pip install `echo dist/*.whl`[dev] "bqplot<0.13" "pandas<3" "ruff==0.8.3" - name: test + env: + REACTON_FAST: ${{ matrix.reacton-fast }} run: pytest --cov=reacton reacton diff --git a/benchmarks/README.md b/benchmarks/README.md new file mode 100644 index 0000000..30dc814 --- /dev/null +++ b/benchmarks/README.md @@ -0,0 +1,182 @@ +# Reacton render benchmarks & the opt-in fast reconciler + +This directory holds the performance harness for a faster reimplementation of +the renderer (the tree-walking downstream of `render()`), plus its design notes. + +The fast renderer is **opt-in and off by default.** The default `_RenderContext` +is the original, unchanged implementation; the rewrite lives in a +`_RenderContextFast(_RenderContext)` subclass that overrides only the +tree-walking methods. Set `REACTON_FAST=1` to select it. CI runs the full test +suite against both (a `reacton-fast: ["0", "1"]` matrix dimension), so the two +stay behavior-identical. + +## Running the benchmarks + +```bash +# default renderer, then the fast one: +python benchmarks/bench.py --label baseline +REACTON_FAST=1 python benchmarks/bench.py --label fast +python benchmarks/compare.py baseline fast +``` + +`bench.py` writes `benchmarks/results/