mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-46072: Add simple stats for Python calls. (GH-30989)
This commit is contained in:
parent
9a24127113
commit
90ab138bbd
4 changed files with 29 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue