bpo-46072: Add some object layout and allocation stats (GH-31051)

This commit is contained in:
Mark Shannon 2022-02-01 15:05:18 +00:00 committed by GitHub
parent 913e340a32
commit 48be46ec1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 1 deletions

View file

@ -105,7 +105,17 @@ def main():
total += value
for key, value in stats.items():
if "Calls to" in key:
print(f"{key}: {value} {100*value/total:0.1f}%")
print(f" {key}: {value} {100*value/total:0.1f}%")
print("Object stats:")
total = stats.get("Object new values")
for key, value in stats.items():
if key.startswith("Object"):
if "materialize" in key:
print(f" {key}: {value} {100*value/total:0.1f}%")
else:
print(f" {key}: {value}")
total = 0
if __name__ == "__main__":
main()