bpo-46072: Add simple stats for Python calls. (GH-30989)

This commit is contained in:
Mark Shannon 2022-01-28 15:20:33 +00:00 committed by GitHub
parent 9a24127113
commit 90ab138bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View file

@ -98,6 +98,14 @@ def main():
for i, opcode_stat in enumerate(opcode_stats):
name = opname[i]
print_specialization_stats(name, opcode_stat)
print("Call stats:")
total = 0
for key, value in stats.items():
if "Calls to" in key:
total += value
for key, value in stats.items():
if "Calls to" in key:
print(f"{key}: {value} {100*value/total:0.1f}%")
if __name__ == "__main__":
main()