-
Notifications
You must be signed in to change notification settings - Fork 4
ci: retain historical benchmark rows on Pages #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,14 @@ function benchmarkMap(document) { | |
| return new Map((document && document.benchmarks || []).map(function (item) { return [item.name, item]; })); | ||
| } | ||
|
|
||
| function benchmarkNamesFromDocuments(documents) { | ||
| const names = new Set(); | ||
| documents.forEach(function (document) { | ||
| (document && document.benchmarks || []).forEach(function (benchmark) { names.add(benchmark.name); }); | ||
| }); | ||
| return Array.from(names).sort(function (a, b) { return a.localeCompare(b, undefined, { sensitivity: "base" }); }); | ||
| } | ||
|
|
||
| function parseBuildTimes(text) { | ||
| const lines = String(text || "").trim().split(/\r?\n/); | ||
| if (lines.length < 2) return new Map(); | ||
|
|
@@ -563,8 +571,8 @@ async function main() { | |
| if (!response.ok) throw new Error("Cannot load the run index"); | ||
| state.index = await response.json(); | ||
| if (!state.index.runs || !state.index.runs.length) throw new Error("No benchmark runs are available"); | ||
| const latest = await loadRun(state.index.runs[0]); | ||
| state.benchmarkNames = (latest.benchmarks || []).map(function (benchmark) { return benchmark.name; }); | ||
| const documents = await Promise.all(state.index.runs.map(loadRun)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eager fetch of every historical run at startup blocks first paint. This replaces the previous single-run fetch with a fan-out over Deriving benchmark names doesn't require loading every run. Options, best first: (1) publish the benchmark-name list in |
||
| state.benchmarkNames = benchmarkNamesFromDocuments(documents); | ||
| state.activeBenchmark = state.benchmarkNames[0] || ""; | ||
| configs.forEach(function (config) { state.activeConfigs.add(config); }); | ||
| dom.benchmarkSelect.innerHTML = state.benchmarkNames.map(function (name) { return '<option value="' + escapeHtml(name) + '">' + escapeHtml(name) + "</option>"; }).join(""); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ordering diverges from the server-generated TSV/summary.
This sorts names case-insensitively (
localeCompare(..., { sensitivity: "base" })), but the server produces each run'sbenchmarksarray viasort -uinreport.sh:60— a byte/locale sort that is case-sensitive underC/POSIX. For the mixed-case names this project uses (XGo,iXGo,Toml,Aws_restjson, ...), these orderings differ: e.g.iXGosorts after all uppercase-initial names undersort -ubut adjacent toXGohere. So the dashboard matrix rows (app.js:316) and the benchmark dropdown (app.js:578) will be ordered differently from the publishedtotal-bytes.tsv/summary.md, and differently from the previous code (which used the latest run's array order matching the TSV).Consider matching
sort -u(plain code-point comparison, orlocaleComparewithoutsensitivity: "base") if cross-referencing the dashboard against the raw TSV matters, or documenting the case-insensitive display order as intentional.