Skip to content

Commit e45bae7

Browse files
authored
GH-114448: Don't sort summarize_stats.py histograms by amount of change (GH-114449)
1 parent 5cd9c6b commit e45bae7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Tools/scripts/summarize_stats.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,11 @@ class JoinMode(enum.Enum):
460460
# second column of each input table as a new column
461461
CHANGE = 1
462462
# Join using the first column as a key, indicating the change in the second
463-
# column of each input table as a ne column, and omit all other columns
463+
# column of each input table as a new column, and omit all other columns
464464
CHANGE_ONE_COLUMN = 2
465+
# Join using the first column as a key, and indicate the change as a new
466+
# column, but don't sort by the amount of change.
467+
CHANGE_NO_SORT = 3
465468

466469

467470
class Table:
@@ -484,7 +487,7 @@ def join_row(self, key: str, row_a: tuple, row_b: tuple) -> tuple:
484487
match self.join_mode:
485488
case JoinMode.SIMPLE:
486489
return (key, *row_a, *row_b)
487-
case JoinMode.CHANGE:
490+
case JoinMode.CHANGE | JoinMode.CHANGE_NO_SORT:
488491
return (key, *row_a, *row_b, DiffRatio(row_a[0], row_b[0]))
489492
case JoinMode.CHANGE_ONE_COLUMN:
490493
return (key, row_a[0], row_b[0], DiffRatio(row_a[0], row_b[0]))
@@ -497,7 +500,7 @@ def join_columns(self, columns: Columns) -> Columns:
497500
*("Base " + x for x in columns[1:]),
498501
*("Head " + x for x in columns[1:]),
499502
)
500-
case JoinMode.CHANGE:
503+
case JoinMode.CHANGE | JoinMode.CHANGE_NO_SORT:
501504
return (
502505
columns[0],
503506
*("Base " + x for x in columns[1:]),
@@ -1027,7 +1030,7 @@ def iter_optimization_tables(base_stats: Stats, head_stats: Stats | None = None)
10271030
Table(
10281031
("Range", "Count:", "Ratio:"),
10291032
calc_histogram_table(name, den),
1030-
JoinMode.CHANGE,
1033+
JoinMode.CHANGE_NO_SORT,
10311034
)
10321035
],
10331036
)

0 commit comments

Comments
 (0)