Skip to content

Add CodSpeed walltime benchmarks workflow - #16

Merged
Ivo Horák (horakivo) merged 6 commits into
developfrom
ci/codspeed-walltime
Nov 27, 2026
Merged

Ivo Horák (horakivo) merged 6 commits into
developfrom
ci/codspeed-walltime

Conversation

@horakivo

@horakivo Ivo Horák (horakivo) commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Adds a workflow (elide-codspeed.yml) that measures GraalPy on CodSpeed (https://app.codspeed.io/elide-dev/graalpython).

What it does

  • build: builds a release native standalone (mx python-svm) on linux-amd64-cipool. The standalone of the unittest workflow is not reused, because it is built with assertions and in quick mode (-Ob).
  • check: on a hosted ubuntu-24.04 runner, unpacks the standalone and runs three C API benchmarks. This checks the artifact hand-off, that the binary runs on a machine other than the one that built it, and that the benchmark extensions compile. No timing is taken from it.
  • walltime: on the self-hosted benchmark runner linux-amd64-bench, runs the 23 C API micro benchmarks (micro-native) and 33 of the 34 pure Python meso benchmarks with the upstream harness and uploads the results to CodSpeed. The statistics are also kept as a workflow artifact, whether or not the upload succeeds.

.github/elide/codspeed-bench is the driver. It reads the benchmark tables from mx_graalpython_bench_param.py, runs every benchmark in its own process, takes the second half of the iterations as samples (the first half is warm-up) and writes CodSpeed's walltime results format. Benchmarks with fewer than 8 iterations are raised to 8, so there are at least 4 samples. meso/chaos-traced is skipped: one iteration takes minutes.

Why walltime

CodSpeed's simulation mode counts instructions under Valgrind and does not measure JIT-compiled code, which is what these benchmarks are about.

Needed before it measures anything

The runner group that holds linux-amd64-bench must be available to this repository, which is public. If it is not, the walltime job stays queued.

The repository variable CODSPEED_WALLTIME_RUNNER selects a different x86_64 runner label; CODSPEED_BUILD_RUNNER does the same for the build.

The build runs on the CI pool rather than on the benchmark host, so that the host is occupied only for the measurement. I expect the measurement to take roughly 25 minutes; that is an estimate from another machine, not a measurement on the runner.

When it runs

  • On every push to develop or an elide-*.x branch.
  • On pull requests labelled perf:bench, from this repository only.
  • Manually with workflow_dispatch, once this is merged.

Not verified

  • The driver was run locally and its output file checked against the schema in the CodSpeed runner's source. Nothing in the workflow has run in CI yet: the build on the pool, the artifact hand-off and the upload are untested.
  • build skips the Python and system package set-up of the unittest build job and relies on what the pool runners already have. walltime relies on the benchmark host having Python 3 and a C compiler.
  • If a benchmark fails, the driver exits 1; I expect the upload to be lost in that case.
  • CODSPEED_PROFILER_ENABLED=false is taken from the runner's own warning text. It is meant to switch off the sampling profiler, which has nothing to attach to because the driver calls no instrumentation hooks.
  • develop starts as a copy of upstream and imports the compiler from oracle/graal, so this measures the upstream code base. The elide-*.x branches would need the workflow cherry-picked to be measured.
  • micro-native/c-many-shortlived-objs takes about 270 s for its 8 iterations.
  • The new script carries the same UPL header, with the Oracle copyright line, as the other files in .github/scripts. Reviewers should say if a different header is wanted.

🤖 Generated with Claude Code

@horakivo
Ivo Horák (horakivo) force-pushed the ci/codspeed-walltime branch 2 times, most recently from 9872976 to cda9ced Compare November 25, 2026 17:54
@horakivo
Ivo Horák (horakivo) changed the base branch from elide-25.6.x to master November 25, 2026 17:54
@horakivo
Ivo Horák (horakivo) marked this pull request as ready for review November 25, 2026 17:55
@horakivo Ivo Horák (horakivo) added the perf:bench Runs walltime bench on our infra label Nov 25, 2026
@codspeed

codspeed Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 56 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

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

Detected benchmarks


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


Open in CodSpeed

@horakivo
Ivo Horák (horakivo) changed the base branch from master to develop November 26, 2026 20:57
Builds a release native standalone on the CI pool, checks it on a hosted
runner, and measures the C API micro benchmarks and the pure Python meso
benchmarks on the self-hosted benchmark runner linux-amd64-bench. Results
go to CodSpeed and are kept as a workflow artifact.

Runs on pushes to master and elide-*.x, and on pull requests labelled
perf:bench.
…runs

Two benchmarks call functions that the public headers do not declare,
which GCC 14 and later reject by default. A failed benchmark no longer
discards the other results: they are uploaded and the job fails afterwards.
The driver moves to .github/elide and the workflow is named
elide-codspeed.yml, so that everything the fork adds is recognisable.
The upstream style job requires an Oracle copyright header in every tracked
.py file. The driver is not Oracle's code, so it drops the copied header and
its extension, like the fork's other CI scripts.
develop is the branch the fork's changes are merged into; master only
mirrors upstream.
@horakivo
Ivo Horák (horakivo) merged commit 17ac452 into develop Nov 27, 2026
26 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