mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-46072: Add some object layout and allocation stats (GH-31051)
This commit is contained in:
parent
913e340a32
commit
48be46ec1f
5 changed files with 51 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue