Skip to content

Add benchmark workflow#449

Draft
sinsoku wants to merge 1 commit intoruby:masterfrom
sinsoku:add-projects-bench
Draft

Add benchmark workflow#449
sinsoku wants to merge 1 commit intoruby:masterfrom
sinsoku:add-projects-bench

Conversation

@sinsoku
Copy link
Copy Markdown
Collaborator

@sinsoku sinsoku commented May 5, 2026

Motivation / Background

We want to prevent regressions by running TypeProf on real-world Ruby code.

Additionally, we want to measure improvements (or deteriorations) in performance and type inference accuracy.

Detail

Run TypeProf against TypeProf itself, Optcarrot, and Redmine on each
push to master, and publish the following metrics as charts on GitHub
Pages:

  • elapsed time (seconds)
  • type coverage per slot (% of argument/return slots inferred)
  • type coverage per method (% of fully-typed methods)

Example (running on my fork):

Setup

Please set Settings → Pages → Source to GitHub Actions (once,
admin only) so the deploy job can publish the dashboard.

Open questions

A couple of open questions:

  1. Remove tool/dog_bench.rb?
    It overlaps with tool/benchmarks/typeprof.rb, but might still be
    useful for ad-hoc profiling.

  2. Run benchmarks on each PR?
    Catches regressions earlier, but each run takes a few minutes.

Run TypeProf against TypeProf itself, Optcarrot, and Redmine on each
push to master, and publish elapsed time and type coverage as charts
on GitHub Pages.

- `tool/benchmarks/<project>.rb` defines each target (repo, ref, setup).
- `tool/benchmark_helper.rb` runs TypeProf and parses `--show-stats`.
- `tool/update_site_data.rb` appends to `tool/site/data.json` and writes
  a per-commit snapshot used to bust CDN cache on the next run.
- `tool/site/index.html` renders charts with Chart.js.
- `.github/workflows/benchmark.yml` runs benchmarks and deploys Pages.
@sinsoku sinsoku force-pushed the add-projects-bench branch from a9078c6 to a7d4144 Compare May 5, 2026 13:24
@sinsoku
Copy link
Copy Markdown
Collaborator Author

sinsoku commented May 5, 2026

@mame
What do you think of the overall direction? Want to make sure I'm on the right track.

@mame
Copy link
Copy Markdown
Member

mame commented May 5, 2026

This looks really nice! I'd like to give it a try.

A few thoughts on the open questions:

  1. tool/dog_bench.rb: I'd like to keep it for now. I do use it for ad-hoc profiling sometimes.
  2. Running on each PR: I think this would be valuable, but more as a test than as a benchmark. It would help us catch cases where a change to TypeProf accidentally breaks it on Redmine or Optcarrot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants