summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/summarize_stats.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-10-26 10:33:12 (GMT)
committerGitHub <noreply@github.com>2023-10-26 10:33:12 (GMT)
commitb0699aa5446eb576ed8ab96989d4f60c7a2a04f8 (patch)
tree90d866c6eb642b4abd6e009050b3d6c5196f720d /Tools/scripts/summarize_stats.py
parent5c9d4497abd2923b4655cee2510208be8540b117 (diff)
downloadcpython-b0699aa5446eb576ed8ab96989d4f60c7a2a04f8.zip
cpython-b0699aa5446eb576ed8ab96989d4f60c7a2a04f8.tar.gz
cpython-b0699aa5446eb576ed8ab96989d4f60c7a2a04f8.tar.bz2
GH-111213: Fix a few broken stats (GH-111216)
Diffstat (limited to 'Tools/scripts/summarize_stats.py')
-rw-r--r--Tools/scripts/summarize_stats.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/Tools/scripts/summarize_stats.py b/Tools/scripts/summarize_stats.py
index 071b24a..165b9b4 100644
--- a/Tools/scripts/summarize_stats.py
+++ b/Tools/scripts/summarize_stats.py
@@ -251,7 +251,8 @@ class OpcodeStats:
def get_specialized_total_counts(self) -> tuple[int, int, int]:
basic = 0
- specialized = 0
+ specialized_hits = 0
+ specialized_misses = 0
not_specialized = 0
for opcode, opcode_stat in self._data.items():
if "execution_count" not in opcode_stat:
@@ -261,16 +262,17 @@ class OpcodeStats:
not_specialized += count
elif opcode in self._specialized_instructions:
miss = opcode_stat.get("specialization.miss", 0)
- not_specialized += miss
- specialized += count - miss
+ specialized_hits += count - miss
+ specialized_misses += miss
else:
basic += count
- return basic, specialized, not_specialized
+ return basic, specialized_hits, specialized_misses, not_specialized
def get_deferred_counts(self) -> dict[str, int]:
return {
opcode: opcode_stat.get("specialization.deferred", 0)
for opcode, opcode_stat in self._data.items()
+ if opcode != "RESUME"
}
def get_misses_counts(self) -> dict[str, int]:
@@ -799,7 +801,8 @@ def specialization_effectiveness_section() -> Section:
(
basic,
- specialized,
+ specialized_hits,
+ specialized_misses,
not_specialized,
) = opcode_stats.get_specialized_total_counts()
@@ -810,7 +813,16 @@ def specialization_effectiveness_section() -> Section:
Count(not_specialized),
Ratio(not_specialized, total),
),
- ("Specialized", Count(specialized), Ratio(specialized, total)),
+ (
+ "Specialized hits",
+ Count(specialized_hits),
+ Ratio(specialized_hits, total),
+ ),
+ (
+ "Specialized misses",
+ Count(specialized_misses),
+ Ratio(specialized_misses, total),
+ ),
]
def calc_deferred_by_table(stats: Stats) -> Rows: