Skip to content

charts: group all Params variants into one chart per benchmark#1861

Merged
badrishc merged 6 commits into
continuousbenchmarkfrom
tiagonapoli/charts-group-by-params
Jun 6, 2026
Merged

charts: group all Params variants into one chart per benchmark#1861
badrishc merged 6 commits into
continuousbenchmarkfrom
tiagonapoli/charts-group-by-params

Conversation

@tiagonapoli

Copy link
Copy Markdown
Collaborator

Problem

The Garnet benchmark charts at https://microsoft.github.io/garnet/charts/ hide every Params variant except None. The FEATURED_BENCHMARKS constant was hardcoded with explicit (Params: None) suffixes:

const FEATURED_BENCHMARKS = Object.freeze([
    `Operations.BasicOperations.InlinePing(Params: None)`,
    // ...
]);

data.js already contains the per-Params entries (Operations.BasicOperations.InlinePing(Params: ACL), (Params: AOF), soon (Params: AAD) from #1859) but the default view never surfaces them. Users have to manually pick each variant from the dropdown to see it — and even then each variant gets its own separate chart, so cross-variant regressions are invisible.

This blocks the value of #1859: the whole point of adding Params: AAD was so a future AAD-path regression like the DateTime.UtcNow one (fixed in #1855) would be visible immediately on the public charts. With the current renderer, the AAD line would appear only if you knew to click into it.

Fix

Render one chart per base benchmark name, with one colored line per Params variant. Same number of charts as before; up to 4× more information per chart.

  • FEATURED_BENCHMARKS — entries are now base names (e.g. Operations.BasicOperations.InlinePing), no (Params: …) suffix. The includes() match then attracts all variants automatically.
  • parseBenchmarkName(fullName) — new helper that splits Foo(Params: X) into {base, params}. Returns {base: fullName, params: null} for legacy entries without a Params suffix.
  • renderGraph(parent, baseName, variants) — refactored to accept a Map<params|null, datapoints[]>. Unions all commit IDs across variants for the x-axis; older variants (None) have longer histories and newer ones (AAD) start mid-axis, rendered as connected gaps via spanGaps: true. Emits one Chart.js dataset per variant with stable per-Params colors:
    • None → green (matches the existing BDN color)
    • ACL → blue
    • AOF → orange
    • AAD → red
    • Anything else cycles through a fallback palette deterministically per session
  • renderBenchSet — groups bench entries by base name before rendering; FEATURED filter compares against the base name so all Params variants pass through.
  • Legend — shown when a chart has more than one dataset (was hidden before since each chart had one line).
  • Tooltips — now prefix each value with the Params label (e.g. AAD: 1048 ns (±5 ns)).

Result

After this change, the default Featured Benchmarks view will show, for example:

Operations.BasicOperations.InlinePing chart with four lines:

That's the symmetry the original reviewer was asking for in #1855: regressions on any auth/AOF path are visible at a glance, on the same plot as the baseline.

Implementation notes

  • File touched: website/static/charts/index.html only. No data format change, no infrastructure change. data.js is untouched and continues to be appended by benchmark-action/github-action-benchmark as today.
  • All filtering logic (OS, Framework, manual benchmark selection) preserved unchanged.
  • The legacy TOOL_COLORS palette is retained but the per-Params palette overrides it for grouped charts (still used as a fallback elsewhere).
  • Variants without a (Params: …) suffix (older benchmarks) get a single line labeled (no params), no regression.

Testing

Verified locally by serving the modified index.html via python -m http.server (so fetch() to https://microsoft.github.io/garnet/charts/data.js and /data_net80.js succeeds — file:// would have been blocked by CORS). The page loads, renders, and the Featured view shows all Params variants of each benchmark grouped into single charts.

Branch note

This branch is based on continuousbenchmark because index.html lives there (alongside data.js). The branch will need to be merged into continuousbenchmark (not main) for the change to take effect on the deployed charts site.

Tiago Napoli added 6 commits June 5, 2026 17:27
Default 'Featured Benchmarks' view previously hardcoded each entry to (Params: None), hiding ACL / AOF / AAD lines that are present in data.js. Refactor the chart renderer to group bench entries by their base name (strip the trailing '(Params: ...)' suffix) and render one chart per base with one colored line per Params variant.

- FEATURED_BENCHMARKS entries are now base names only (e.g. 'Operations.BasicOperations.InlinePing'); the includes() match attracts all variants automatically.

- New parseBenchmarkName helper splits 'Foo(Params: X)' into {base, params}; null params falls back to the legacy '(no params)' label.

- renderGraph accepts a Map<params, datapoints[]>, unions all commit ids across variants for the x-axis (older variants like None have longer histories; newer ones like AAD start partway through and render as gaps via spanGaps:true), and emits one Chart.js dataset per variant with a stable per-Params color (None=green, ACL=blue, AOF=orange, AAD=red, fallback palette for the rest).

- renderBenchSet now groups benchSet entries by base name before invoking renderGraph; FEATURED filter compares against the base name so all Params variants pass through.

- Legend is shown when a chart has >1 dataset; tooltips include the Params label.

Net effect: visiting https://microsoft.github.io/garnet/charts/ now shows ACL / AOF / AAD lines on every Featured benchmark, on the same plot as None — making regressions in any Params variant immediately visible.
Follow-up to the per-Params grouping change in 71af47d. The Benchmark dropdown still listed every '(Params: X)' variant as a separate option, so selecting one would force the chart back to a single-variant view — defeating the grouping when the user wanted to focus on one benchmark.

- populateBenchmarkSelector now dedupes by base name (using parseBenchmarkName) so each benchmark appears exactly once in its optgroup.

- renderBenchSet's SELECTED_BENCHMARK filter now compares against the base name instead of the full bench name, so selecting 'Operations.BasicOperations.InlinePing' shows one chart with all Params variants (None / ACL / AOF / AAD) instead of zero matches.

- Net UX: pick a matrix entry from Benchmark Group → pick a base benchmark from Benchmark → see one focused chart with every Params variant on it.

- Caveat: old shareable URLs that encoded '(Params: X)' suffixes in the ?benchmark= param will silently fall back to 'All' since the option values no longer match. Acceptable for this UI improvement; can be added as a URL-back-compat shim if needed.
When the user selects a Benchmark Group (a matrix entry like 'Operations.BasicOperations (ubuntu-latest net10.0 Release)'), the surrounding h4 displays the matrix entry name but the individual charts within (InlinePing, Set, GetFound, Increment, IncrementBy) were visually indistinguishable — same group heading, no per-chart label.

renderGraph now wraps each canvas in a div with an h5 sub-heading showing the leaf name (everything after the last '.'); the parent h4 already carries the package context so 'Operations.BasicOperations.InlinePing' renders as just 'InlinePing'. Hover tooltip on the heading shows the fully-qualified base name.
HTML optgroup labels are not clickable on their own. In the Featured view, the user wanted to be able to click a group header (e.g. 'Operations.RawStringOperations (ubuntu-latest net10.0 Release)') to focus on just that group's charts — previously the only way was to switch the upper Benchmark Group dropdown manually.

- Each optgroup now begins with a selectable '(All benchmarks in this group)' option whose value is prefixed with 'GROUP:'.

- The benchmark-selector change handler detects the GROUP: prefix and atomically (a) switches the Benchmark Group dropdown to that matrix entry, (b) resets Benchmark to 'All', (c) repopulates and re-renders. Same outcome as manually picking the matrix entry from the top dropdown, just discoverable directly from the optgroup header.
Pure cleanup commit — no behavior change. Reduces the cumulative PR diff so reviewers see less code:

- Trim verbose multi-line comments to one-liners; comments now point at non-obvious intent only.

- Collapse the PARAMS_COLORS + fallback-palette + assignment counter into one shared PARAMS_PALETTE array indexed by a tiny dict for known names plus a Map for unknowns.

- parseBenchmarkName is now a single expression with the colon-position math inline.

- renderGraph: drop the redundant wrapper div (h5 + canvas are direct siblings of parent); extract a shared lookupDp helper for the tooltip callbacks; use optional chaining / ?? for the data-mapping and unit-pickup; tightened onClick to a one-liner.

- renderBenchSet: drop noisy comments; rewrite filter as flat continues; remove the lowercase() call inside FEATURED_BENCHMARKS.some() (FEATURED_BENCHMARKS is already lowercased at definition).
@badrishc badrishc merged commit b89cc9e into continuousbenchmark Jun 6, 2026
1 check passed
@badrishc badrishc deleted the tiagonapoli/charts-group-by-params branch June 6, 2026 04:33
badrishc pushed a commit that referenced this pull request Jun 6, 2026
…#1863)

* Revert "charts: group all Params variants into one chart per benchmark (#1861)"

This reverts commit b89cc9e.

* charts: add AAD variants for Operations.* benchmarks to Featured

PR #1859 added Params: AAD as a 4th first-class OperationParams variant. The Featured Benchmarks view didn't surface the new AAD charts because FEATURED_BENCHMARKS only listed the (Params: None) entry for each benchmark.

Add the 8 corresponding (Params: AAD) entries for the Operations.* benchmarks that gained an AAD variant. Network.* and Lua.* are unchanged since OperationsBase's useAad flag only applies to the Operations.* hierarchy.

---------

Co-authored-by: Tiago Napoli <[email protected]>
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