8000 gh-100239: more refined specialisation stats for BINARY_OP/SUBSCR by iritkatriel · Pull Request #132068 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-100239: more refined specialisation stats for BINARY_OP/SUBSCR #132068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
calculate max failure index
  • Loading branch information
iritkatriel committed Apr 4, 2025
commit d7052e4650b3939f5cff779967beb1bf3cf6c1d2
14 changes: 11 additions & 3 deletions Tools/scripts/summarize_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,20 @@ def kind_to_text(kind: int, opcode: str):
return "kind " + str(kind)

family_stats = self._get_stats_for_opcode(opcode)
failure_kinds = [0] * 40

def key_to_index(key):
return int(key[:-1].split("[")[1])

max_index = 0
for key in family_stats:
if key.startswith("specialization.failure_kind"):
max_index = max(max_index, key_to_index(key))

failure_kinds = [0] * (max_index + 1)
for key in family_stats:
if not key.startswith("specialization.failure_kind"):
continue
index = int(key[:-1].split("[")[1])
failure_kinds[index] = family_stats[key]
failure_kinds[key_to_index(key)] = family_stats[key]
return {
kind_to_text(index, opcode): value
for (index, value) in enumerate(failure_kinds)
Expand Down
Loading
0