feat: group benchmarks in the PR comment and trend dashboard#5
Merged
Conversation
A flat table is fine for a handful of benchmarks, but the wardnet suite has grown past 30 and a single wall of rows drowns the signal. Group deltas by their leading id segment — criterion's benchmark_group, the "group" in a group/function/value id — and render each as a collapsible <details> section: a summary line (name, size, verdict) with the table folded behind it. Sections that hold a regression open by default so problems stay visible without a click; clean groups collapse. Row ids drop the redundant group prefix now that the section header carries it. Suites with a single group keep the old flat table, so small projects see no change.
Mirror the PR comment's sectioning on the trend dashboard: bucket the charts by their leading id segment and render each group as a collapsible section with a header (name + count), so a 30-plus-chart page can be folded down to the groups a reviewer cares about. Chart captions drop the group prefix the section header already shows, and the subtitle now reports the group count. A single-group suite still renders the flat grid. Rebuilt the vendored single-file bundle so the embedded dashboard matches source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The wardnet suite has grown past 30 benchmarks. At that size the PR comment's
single table and the dashboard's flat grid of charts are hard to scan — the few
benchmarks that actually moved get lost in a wall of rows.
What
Fold both views into sections keyed by benchmark group — the leading segment
of a criterion
group/function/valueid (itsbenchmark_group). No schemachange: the grouping is derived from ids that already carry it, so recorded
baselines and existing dashboards keep working.
PR comment (
internal/report)<details>section with a summary line:name · size · verdict (
⚠️ N slower,🚀 faster, or✅).so problems stay one glance away and everything else stays out of the way.
parse/a, notdns/parse/a) now thatthe section header carries it.
no change.
Trend dashboard (
web/)header and count; captions drop the group prefix and the subtitle reports the
group count.
Ungrouped, top-level benches (ids with no
/) collect in a trailingungroupedsection in both views.
Tests
Added
internal/reportcoverage for the sectioning, prefix stripping, thesingle-group flat fallback, per-group verdicts, and ungrouped-last ordering.
go test -race ./...,go vet,gofmt, and the dashboard bundle-drift checkall pass.