diff options
author | Mark Shannon <mark@hotpy.org> | 2022-01-28 15:20:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 15:20:33 (GMT) |
commit | 90ab138bbdc63763ad825ed6d4821367c09c4015 (patch) | |
tree | 3adaef410013002de2e488d9c37fb6abc3462082 /Tools/scripts/summarize_stats.py | |
parent | 9a241271139a317597aca71d5971346b2cfe7dbd (diff) | |
download | cpython-90ab138bbdc63763ad825ed6d4821367c09c4015.zip cpython-90ab138bbdc63763ad825ed6d4821367c09c4015.tar.gz cpython-90ab138bbdc63763ad825ed6d4821367c09c4015.tar.bz2 |
bpo-46072: Add simple stats for Python calls. (GH-30989)
Diffstat (limited to 'Tools/scripts/summarize_stats.py')
-rw-r--r-- | Tools/scripts/summarize_stats.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tools/scripts/summarize_stats.py b/Tools/scripts/summarize_stats.py index 3a77125..34cbad5 100644 --- a/Tools/scripts/summarize_stats.py +++ b/Tools/scripts/summarize_stats.py @@ -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() |