@@ -1759,12 +1759,6 @@ def create_exception():
1759
1759
logging .info ("%s %s -c ### %s %s" , self .superpmi_path , " " .join (altjit_replay_flags ), self .diff_jit_path , mch_file )
1760
1760
logging .info ("" )
1761
1761
1762
- smallest = sorted (diffs , key = lambda r : int (r ["Context size" ]))[:20 ]
1763
- logging .debug ("Smallest {} contexts with binary differences:" .format (len (smallest )))
1764
- for diff in smallest :
1765
- logging .debug (diff ["Context" ])
1766
- logging .debug ("" )
1767
-
1768
1762
if base_metrics is not None and diff_metrics is not None :
1769
1763
base_bytes = int (base_metrics ["Overall" ]["Diffed code bytes" ])
1770
1764
diff_bytes = int (diff_metrics ["Overall" ]["Diffed code bytes" ])
@@ -2117,15 +2111,26 @@ def pick_contexts_to_disassemble(self, diffs):
2117
2111
# available without needing to disassemble all, so pick a subset of
2118
2112
# interesting diffs to pass to jit-analyze.
2119
2113
2114
+ def display_subset (message , subset ):
2115
+ logging .debug (message .format (len (subset )))
2116
+ for diff in subset :
2117
+ logging .debug (diff ["Context" ])
2118
+ logging .debug ("" )
2119
+
2120
2120
# 20 smallest method contexts with diffs
2121
2121
smallest_contexts = sorted (diffs , key = lambda r : int (r ["Context size" ]))[:20 ]
2122
+ display_subset ("Smallest {} contexts with binary differences:" , smallest_contexts )
2123
+
2122
2124
# Order by byte-wise improvement, largest improvements first
2123
2125
by_diff_size = sorted (diffs , key = lambda r : int (r ["Diff size" ]) - int (r ["Base size" ]))
2124
2126
# 20 top improvements, byte-wise
2125
2127
top_improvements_bytes = by_diff_size [:20 ]
2126
2128
# 20 top regressions, byte-wise
2127
2129
top_regressions_bytes = by_diff_size [- 20 :]
2128
2130
2131
+ display_subset ("Top {} improvements, byte-wise:" , top_improvements_bytes )
2132
+ display_subset ("Top {} regressions, byte-wise:" , top_regressions_bytes )
2133
+
2129
2134
# Order by percentage-wise size improvement, largest improvements first
2130
2135
def diff_pct (r ):
2131
2136
base = int (r ["Base size" ])
@@ -2138,7 +2143,16 @@ def diff_pct(r):
2138
2143
top_improvements_pct = by_diff_size_pct [:20 ]
2139
2144
top_regressions_pct = by_diff_size_pct [- 20 :]
2140
2145
2141
- contexts = smallest_contexts + top_improvements_bytes + top_regressions_bytes + top_improvements_pct + top_regressions_pct
2146
+ display_subset ("Top {} improvements, percentage-wise:" , top_improvements_pct )
2147
+ display_subset ("Top {} regressions, percentage-wise:" , top_regressions_pct )
2148
+
2149
+ # 20 contexts without size diffs (possibly GC info diffs), sorted by size
2150
+ zero_size_diffs = filter (lambda r : int (r ["Diff size" ]) == int (r ["Base size" ]), diffs )
2151
+ smallest_zero_size_contexts = sorted (zero_size_diffs , key = lambda r : int (r ["Context size" ]))[:20 ]
2152
+
2153
+ display_subset ("Smallest {} zero sized diffs:" , smallest_zero_size_contexts )
2154
+
2155
+ contexts = smallest_contexts + top_improvements_bytes + top_regressions_bytes + top_improvements_pct + top_regressions_pct + smallest_zero_size_contexts
2142
2156
2143
2157
final_contexts_indices = list (set (int (r ["Context" ]) for r in contexts ))
2144
2158
final_contexts_indices .sort ()
0 commit comments