summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-02-04 09:56:46 (GMT)
committerGitHub <noreply@github.com>2022-02-04 09:56:46 (GMT)
commit832876b99212999c063cbf41bdacc574da699190 (patch)
tree5adb758bb9e6ca2e9913a0b292c55fdebb04e406 /Tools/scripts
parentba650af7d660084e08859dd1ee1917cccee24e88 (diff)
downloadcpython-832876b99212999c063cbf41bdacc574da699190.zip
cpython-832876b99212999c063cbf41bdacc574da699190.tar.gz
cpython-832876b99212999c063cbf41bdacc574da699190.tar.bz2
Add miss stats for specialized instructions. (GH-31108)
Diffstat (limited to 'Tools/scripts')
-rw-r--r--Tools/scripts/summarize_stats.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Tools/scripts/summarize_stats.py b/Tools/scripts/summarize_stats.py
index f67a35a..6d00207 100644
--- a/Tools/scripts/summarize_stats.py
+++ b/Tools/scripts/summarize_stats.py
@@ -22,11 +22,10 @@ for name in opcode.opname[1:]:
pass
opname.append(name)
-
TOTAL = "specialization.deferred", "specialization.hit", "specialization.miss", "execution_count"
def print_specialization_stats(name, family_stats):
- if "specialization.failure" not in family_stats:
+ if "specializable" not in family_stats:
return
total = sum(family_stats.get(kind, 0) for kind in TOTAL)
if total == 0:
@@ -87,13 +86,18 @@ def main():
for i, opcode_stat in enumerate(opcode_stats):
if "execution_count" in opcode_stat:
count = opcode_stat['execution_count']
- counts.append((count, opname[i]))
+ miss = 0
+ if "specializable" not in opcode_stat:
+ miss = opcode_stat.get("specialization.miss")
+ counts.append((count, opname[i], miss))
total += count
counts.sort(reverse=True)
cummulative = 0
- for (count, name) in counts:
+ for (count, name, miss) in counts:
cummulative += count
print(f"{name}: {count} {100*count/total:0.1f}% {100*cummulative/total:0.1f}%")
+ if miss:
+ print(f" Misses: {miss} {100*miss/count:0.1f}%")
print("Specialization stats:")
for i, opcode_stat in enumerate(opcode_stats):
name = opname[i]