Skip to content

Commit b054467

Browse files
fix: revert to single-segment sort/labels for stacked charts
Use underscore separator in RSS labels instead of slash, so the existing .pop() logic works for all stacked charts without breaking timing component labels.
1 parent 665f4d6 commit b054467

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

bench/index.html

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -788,23 +788,18 @@
788788
"#2471a3", "#a93226", "#229954", "#d4ac0d", "#4ae24a",
789789
];
790790

791-
// Sort: put total_ms first (thicker line), then rest by last 2 segments
792-
// (e.g. "06_EcdsaRAccount:entrypoint/0_alloc") so circuit index sorts first
791+
// Sort: put total_ms first (thicker line), then rest alphabetically
793792
const sorted = [...stackedItems].sort((a, b) => {
794-
const aParts = a.fullKey.split("/");
795-
const bParts = b.fullKey.split("/");
796-
const aName = aParts.length >= 2 ? aParts.slice(-2).join("/") : aParts.pop();
797-
const bName = bParts.length >= 2 ? bParts.slice(-2).join("/") : bParts.pop();
798-
if (aName.endsWith("total_ms")) return -1;
799-
if (bName.endsWith("total_ms")) return 1;
793+
const aName = a.fullKey.split("/").pop();
794+
const bName = b.fullKey.split("/").pop();
795+
if (aName === "total_ms") return -1;
796+
if (bName === "total_ms") return 1;
800797
return aName.localeCompare(bName);
801798
});
802799

803800
const datasets = sorted.map((item, i) => {
804801
const color = colors[i % colors.length];
805-
// Use last 2 segments for labels like "06_EcdsaRAccount:entrypoint/after_accumulate"
806-
const parts = item.fullKey.split("/");
807-
const metricName = parts.length >= 2 ? parts.slice(-2).join("/") : parts.pop();
802+
const metricName = item.fullKey.split("/").pop();
808803
const isTotal = metricName.endsWith("total_ms");
809804
const valueMap = new Map();
810805
item.benches.forEach((entry) => {

0 commit comments

Comments
 (0)