mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)
This commit is contained in:
parent
3fa023721b
commit
a4460f2eb8
6 changed files with 24 additions and 0 deletions
|
@ -272,6 +272,8 @@ def emit_object_stats(stats):
|
|||
with Section("Object stats", summary="allocations, frees and dict materializatons"):
|
||||
total_materializations = stats.get("Object new values")
|
||||
total_allocations = stats.get("Object allocations")
|
||||
total_increfs = stats.get("Object interpreter increfs") + stats.get("Object increfs")
|
||||
total_decrefs = stats.get("Object interpreter decrefs") + stats.get("Object decrefs")
|
||||
rows = []
|
||||
for key, value in stats.items():
|
||||
if key.startswith("Object"):
|
||||
|
@ -279,6 +281,10 @@ def emit_object_stats(stats):
|
|||
ratio = f"{100*value/total_materializations:0.1f}%"
|
||||
elif "allocations" in key:
|
||||
ratio = f"{100*value/total_allocations:0.1f}%"
|
||||
elif "increfs" in key:
|
||||
ratio = f"{100*value/total_increfs:0.1f}%"
|
||||
elif "decrefs" in key:
|
||||
ratio = f"{100*value/total_decrefs:0.1f}%"
|
||||
else:
|
||||
ratio = ""
|
||||
label = key[6:].strip()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue