|
788 | 788 | "#2471a3", "#a93226", "#229954", "#d4ac0d", "#4ae24a", |
789 | 789 | ]; |
790 | 790 |
|
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 |
793 | 792 | 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; |
800 | 797 | return aName.localeCompare(bName); |
801 | 798 | }); |
802 | 799 |
|
803 | 800 | const datasets = sorted.map((item, i) => { |
804 | 801 | 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(); |
808 | 803 | const isTotal = metricName.endsWith("total_ms"); |
809 | 804 | const valueMap = new Map(); |
810 | 805 | item.benches.forEach((entry) => { |
|
0 commit comments