You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b34e33
Browse filesBrowse the repository at this point in the historyBrowse files
build(bench): micro-benchmarks run on the newest Python, in a nox session
The shared tooling at v0.73.0 runs `just bench::micro` in the
noxfile's sessions tagged `bench` instead of the floor `.venv`; this
project's noxfile gains the `bench` session (one per supported
Python, the tag on the newest, 3.15 today). Results are saved per
interpreter, and `bench::compare` compares runs of one interpreter.
On 3.15 the JSON comparison now gives pyparsing 2.15x and parsy 1.73x
(medians, `just bench::micro`), in line with the depth sweep on 3.15
(2.22x, 1.69x); on 3.12 the two harnesses disagreed by up to 40%,
with the starting call-stack depth (python/cpython#142183).
benchmarks/README.md says so, and how to run another interpreter.
`.nox/` is ignored: the uv environments in it hide themselves, a
repository without them should not depend on that.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: benchmarks/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
Micro-benchmarks of tokenizing and parsing: `just bench::micro` runs them, `just bench::compare` compares saved runs,
4
4
and `CONVENTIONS.md`'s Benchmarks section has the rules.
5
5
6
+
They run in the noxfile's `bench` session tagged `bench`, on the newest supported Python; another interpreter's runs by
7
+
name, `just tools::nox -s "bench(python='3.14')" -- benchmarks`. Quote a figure with the interpreter it ran on. On
8
+
Python 3.12 a recursive parser's time depends on the call-stack depth it starts at (up to 57% here, CPython's slow path
9
+
for calls across data-stack chunks, [python/cpython#142183](https://github.com/python/cpython/issues/142183)); on 3.14
10
+
and 3.15 it varies by about 1 ms.
11
+
6
12
-`bench_grammars.py`: whole grammars over a generated document, the JSON and DOT grammars of `tests/` and the
7
13
calculator of `examples/`.
8
14
-`bench_combinators.py`: one combinator each, over a long input, so a regression points at its combinator.
0 commit comments