Skip to content

CodSpeed: interpreter-only, start-up and memory rows; split orjson - #23

Merged
Ivo Horák (horakivo) merged 3 commits into
developfrom
bench/memory-interpreter-startup
Nov 29, 2026
Merged

Ivo Horák (horakivo) merged 3 commits into
developfrom
bench/memory-interpreter-startup

Conversation

@horakivo

Copy link
Copy Markdown
Member

The suite measured only warmed-up peak time. This adds rows for code that is not JIT-compiled, for start-up, and for memory footprint, and splits the orjson row into parsing and serialising.

What each suite measures

  • interp: six meso benchmarks (richards3, bm-float, nbody3, raytrace-simple, fannkuchredux3, fasta3) on small sizes with --experimental-options --engine.Compilation=false. These options belong to the suite, so they are also used when reporting to CodSpeed. Rows are interp/<name>[<size>], next to the compiled meso/<name>[<size>].
  • startup: each iteration starts fresh processes of the interpreter, with the parent's options, and waits for them: -c pass, imports of a fixed set of 12 standard-library modules, and a small pure-Python workload run once.
  • memory: scripts run without the harness, one fresh process per iteration. The runner takes each process's wall time and peak RSS (wait4). Rows: idle after start-up, after the import set, and holding 1M small instances, 1M small dicts or 1M short strings.
  • packages/orjson-loads and orjson-dumps: the two halves of orjson-roundtrip, on the same document. The round-trip row is unchanged.

How to read the memory rows

Every memory benchmark has two CodSpeed rows. memory/<name>[<size>] is the wall time of one process. memory/<name>[<size>][peak-rss: 1 ms = 1 MiB] is its peak RSS shown as a time: 300 ms means 300 MiB, and faster means smaller. The value is the median over the sampled processes and is the same in every round. walltime-summary.json keeps these under memory, apart from the times. The run's summary page lists the peak RSS of every benchmark in every suite.

Known limits

  • Sizes are estimates until the first run on the benchmark host. A resize is a one-line change in benchmarks.txt and starts a new history on CodSpeed.
  • Peak RSS includes garbage and depends on GraalPy's heap sizing.
  • For harness rows the table's RSS covers the whole harness process. For startup rows on Linux it is the larger of the harness process and its children.
  • The peak-RSS results rely on CodSpeed accepting results with zero spread; this run is the first test of that.
  • --no-suite-options lets you run the suites on CPython by hand. There is no CPython job yet.

Testing

Each new row was run to completion with four iterations on a macOS build and on CPython; nothing was timed there. The first run on the benchmark host is the one on this pull request.

🤖 Generated with Claude Code

orjson-loads and orjson-dumps run the parsing and the serialising half of
orjson-roundtrip on the same document, built by orjson-roundtrip's own
make_doc, so that the two can be judged separately. Their expected results
are the corresponding parts of orjson-roundtrip's. orjson-roundtrip is
unchanged.
interp runs six meso benchmarks on small sizes with
--experimental-options --engine.Compilation=false. The options belong to
the suite, so they are also given when reporting to CodSpeed;
--no-suite-options leaves them out, for comparisons with CPython, and is
refused when reporting.

startup is in the harness format; an iteration starts fresh processes of
sys.executable with the harness process's interpreter options (from
sys.orig_argv): -c pass, a fixed set of standard library imports, and a
small pure Python workload run once.

memory runs scripts without the harness, one fresh process per iteration,
and takes the wall time and the peak RSS (wait4) of each process: idle
after start-up, after the import set, and holding a million instances,
dicts or short strings. Each benchmark gets a second CodSpeed result,
<name>[peak-rss: 1 ms = 1 MiB], whose time is the median peak RSS of the
sampled processes, constant over its rounds. walltime-summary.json keeps
these under "memory", apart from the times.

The driver also writes walltime-summary.md, a table of the peak RSS of
every benchmark, and now reports ru_maxrss in KiB on macOS too.
The walltime job runs the three new suites after the existing ones and
appends the peak RSS table to the run's summary page, also when a
benchmark failed; the artifact keeps the table. The check job runs the new
suites for four iterations first, so that an option the build does not
know fails on the pool. The README describes the suites, the orjson rows
and how to read the peak RSS rows.
@horakivo Ivo Horák (horakivo) added the perf:bench Runs walltime bench on our infra label Nov 28, 2026
@codspeed

codspeed Bot commented Nov 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

✅ 66 untouched benchmarks
🆕 21 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 memory/dicts[1000000] N/A 282.5 ms N/A
🆕 memory/dicts[1000000][peak-rss: 1 ms = 1 MiB] N/A 408.8 ms N/A
🆕 memory/idle N/A 23.9 ms N/A
🆕 memory/idle[peak-rss: 1 ms = 1 MiB] N/A 167.7 ms N/A
🆕 memory/objects[1000000] N/A 273.5 ms N/A
🆕 memory/objects[1000000][peak-rss: 1 ms = 1 MiB] N/A 367.3 ms N/A
🆕 memory/stdlib-imports N/A 251.9 ms N/A
🆕 memory/stdlib-imports[peak-rss: 1 ms = 1 MiB] N/A 308.5 ms N/A
🆕 memory/strings[1000000] N/A 333.4 ms N/A
🆕 memory/strings[1000000][peak-rss: 1 ms = 1 MiB] N/A 360.8 ms N/A
🆕 interp/bm-float[4] N/A 85.4 ms N/A
🆕 interp/fannkuchredux3[8] N/A 75.7 ms N/A
🆕 interp/fasta3[50000] N/A 118.1 ms N/A
🆕 interp/nbody3[30000] N/A 232 ms N/A
🆕 interp/raytrace-simple[50,50] N/A 182.6 ms N/A
🆕 interp/richards3[1] N/A 97.2 ms N/A
🆕 packages/orjson-dumps[2500] N/A 170.2 ms N/A
🆕 packages/orjson-loads[2500] N/A 533.5 ms N/A
🆕 startup/first-run[3] N/A 423.3 ms N/A
🆕 startup/pass[10] N/A 405.7 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing bench/memory-interpreter-startup (404f851) with develop (2fd8b45)

Open in CodSpeed

@horakivo
Ivo Horák (horakivo) merged commit 55fc469 into develop Nov 29, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf:bench Runs walltime bench on our infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant