Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ci/llgo-size/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ The published dashboard presents wall time as its primary human-facing duration
and retains `user + sys` as secondary diagnostic context. Binary size and wall
time use separate commit matrices on the same page; each cell is ranked against
the other build modes for the same benchmark and commit, with smaller values
receiving the stronger favorable background.
receiving the stronger favorable background. Matrix rows are visually grouped
by benchmark: the benchmark name appears once at the start of its build modes,
and a full-width separator marks the next benchmark.

The `llgo-main-updated` repository-dispatch event from `xgo-dev/llgo` first
updates `LLGO_COMMIT` on the benchmarks `main` branch, then explicitly starts a
Expand Down
9 changes: 6 additions & 3 deletions ci/llgo-size/site/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,15 @@ function renderMatrix(target, runs, documents, baselineDocument, measure) {
const head = '<thead><tr><th class="matrix-label-cell">Benchmark / mode</th>' + runs.map(headerHtml).join("") + "</tr></thead>";
const rows = [];
state.benchmarkNames.forEach(function (benchmarkName) {
configs.forEach(function (config) {
const label = '<th class="matrix-label-cell"><span class="benchmark-name">' + escapeHtml(benchmarkName) + '</span><span class="config-name">' + escapeHtml(compactConfigLabels[config]) + "</span></th>";
configs.forEach(function (config, configIndex) {
const benchmarkLabel = configIndex === 0 ? '<span class="benchmark-name">' + escapeHtml(benchmarkName) + "</span>" : "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor (DRY): configIndex === 0 is tested three times in this loop (lines 310, 311, 316). Hoisting const isGroupStart = configIndex === 0; at the top of the callback and reusing it would remove the repetition and make the grouping intent self-documenting.

const configClass = configIndex === 0 ? "config-name" : "config-name config-continuation";
const label = '<th class="matrix-label-cell" aria-label="' + escapeHtml(benchmarkName + " · " + compactConfigLabels[config]) + '">' + benchmarkLabel + '<span class="' + configClass + '">' + escapeHtml(compactConfigLabels[config]) + "</span></th>";
const cells = runs.map(function (run, index) {
return cellHtml(maps[index].get(benchmarkName), config, measure, run.key, baselineMap.get(benchmarkName));
}).join("");
rows.push("<tr>" + label + cells + "</tr>");
const groupClass = configIndex === 0 ? "benchmark-group-start" : "";
rows.push('<tr class="' + groupClass + '">' + label + cells + "</tr>");
});
});
target.classList.toggle("comparison-mode", state.comparisonMode);
Expand Down
4 changes: 4 additions & 0 deletions ci/llgo-size/site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ select:focus, input:focus, button:focus-visible { border-color: #5c82e8; outline
.comparison-table thead th { background: #f7f9fd; color: #566982; font-size: 9px; font-weight: 850; text-align: center; }
.comparison-table tbody th { background: #fff; text-align: left; }
.comparison-table tbody tr:hover th { background: #f8faff; }
.comparison-table tbody .benchmark-group-start:not(:first-child) > * { border-top: 7px solid #e7edf5; box-shadow: inset 0 1px 0 #b7c4d5; }
.comparison-table tbody .benchmark-group-start:not(:first-child) > .selected-a,
.comparison-table tbody .benchmark-group-start:not(:first-child) > .selected-b { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent), inset 0 1px 0 #b7c4d5; }
.comparison-table tbody tr:last-child > * { border-bottom: 0; }
.comparison-table tr > *:last-child { border-right: 0; }
.matrix-label-cell { position: sticky; left: 0; z-index: 2; width: 136px; min-width: 136px; max-width: 136px; padding: 7px !important; overflow-wrap: anywhere; white-space: normal !important; }
.comparison-table thead .matrix-label-cell { z-index: 4; background: #f7f9fd; color: #294369; line-height: 1.2; }
.benchmark-name { display: block; color: #18365d; font-size: 10px; font-weight: 800; line-height: 1.2; }
.config-name { display: block; margin-top: 2px; color: #718097; font-size: 9px; font-weight: 700; line-height: 1.15; }
.config-continuation { margin-top: 0; padding-left: 9px; border-left: 2px solid #d5deea; }
.commit-header { width: 132px; min-width: 132px; padding: 0 !important; }
.commit-button { display: grid; width: 100%; min-height: 53px; padding: 7px 6px; border: 0; background: transparent; color: inherit; place-content: center; }
.comparison-mode .commit-button:hover { background: #edf3ff; color: #204ba8; }
Expand Down