Skip to content

Commit d446876

Browse files
committed
wip
1 parent 0efe6ac commit d446876

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

benchmark/reports.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,22 @@ async function generateOpcodeAnalysis() {
7575
(row) => `${row.contract_name}:${row.transaction_name}`,
7676
)
7777

78-
for (const opcodes of Object.values(byTransaction)) {
78+
// Sort entries by contract_id, then transaction_name
79+
const sortedEntries = Object.entries(byTransaction).sort((a, b) => {
80+
const txA = a[1]?.[0]
81+
const txB = b[1]?.[0]
82+
if (!txA || !txB) return 0
83+
84+
// First sort by contract_id
85+
if (txA.contract_id !== txB.contract_id) {
86+
return txA.contract_id.localeCompare(txB.contract_id)
87+
}
88+
89+
// Then by transaction_name
90+
return txA.transaction_name.localeCompare(txB.transaction_name)
91+
})
92+
93+
for (const [, opcodes] of sortedEntries) {
7994
if (!opcodes) continue
8095

8196
const tx = opcodes[0]

0 commit comments

Comments
 (0)