]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Summarize stats: Increase number of predecessor/successor pairs shown from 3 to 5...
authorMark Shannon <mark@hotpy.org>
Tue, 17 May 2022 09:59:24 +0000 (10:59 +0100)
committerGitHub <noreply@github.com>
Tue, 17 May 2022 09:59:24 +0000 (10:59 +0100)
Tools/scripts/summarize_stats.py

index 91b190114008eade8a4dbc4f455e3ebccf5032c8..f66fc7b684594f5e4727ebd017748e46d6a4c27c 100644 (file)
@@ -315,7 +315,7 @@ def emit_pair_counts(opcode_stats, total):
         emit_table(("Pair", "Count:", "Self:", "Cumulative:"),
             rows
         )
-    with Section("Predecessor/Successor Pairs", summary="Top 3 predecessors and successors of each opcode"):
+    with Section("Predecessor/Successor Pairs", summary="Top 5 predecessors and successors of each opcode"):
         predecessors = collections.defaultdict(collections.Counter)
         successors = collections.defaultdict(collections.Counter)
         total_predecessors = collections.Counter()
@@ -334,10 +334,10 @@ def emit_pair_counts(opcode_stats, total):
             pred_rows = succ_rows = ()
             if total1:
                 pred_rows = [(opname[pred], count, f"{count/total1:.1%}")
-                             for (pred, count) in predecessors[i].most_common(3)]
+                             for (pred, count) in predecessors[i].most_common(5)]
             if total2:
                 succ_rows = [(opname[succ], count, f"{count/total2:.1%}")
-                             for (succ, count) in successors[i].most_common(3)]
+                             for (succ, count) in successors[i].most_common(5)]
             with Section(name, 3, f"Successors and predecessors for {name}"):
                 emit_table(("Predecessors", "Count:", "Percentage:"),
                     pred_rows