mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Classify specialization failures. Provides more useful stats, with lower overhead. (GH-27701)
This commit is contained in:
parent
c7ea1e3dce
commit
9816777861
4 changed files with 100 additions and 100 deletions
|
@ -23,6 +23,18 @@ def print_stats(name, family_stats):
|
|||
print(f"{key:>12}:{family_stats[key]:>12} {100*family_stats[key]/total:0.1f}%")
|
||||
for key in ("specialization_success", "specialization_failure"):
|
||||
print(f" {key}:{family_stats[key]:>12}")
|
||||
total_failures = family_stats["specialization_failure"]
|
||||
failure_kinds = [ 0 ] * 20
|
||||
for key in family_stats:
|
||||
if not key.startswith("specialization_failure_kind"):
|
||||
continue
|
||||
_, index = key[:-1].split("[")
|
||||
index = int(index)
|
||||
failure_kinds[index] = family_stats[key]
|
||||
for index, value in enumerate(failure_kinds):
|
||||
if not value:
|
||||
continue
|
||||
print(f" kind {index:>2}: {value:>8} {100*value/total_failures:0.1f}%")
|
||||
|
||||
def main():
|
||||
stats = collections.defaultdict(collections.Counter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue