MCPcopy Index your code
hub / github.com/python/cpython / object_stats_section

Function object_stats_section

Tools/scripts/summarize_stats.py:1129–1156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1127
1128
1129def object_stats_section() -> Section:
1130 def calc_object_stats_table(stats: Stats) -> Rows:
1131 object_stats = stats.get_object_stats()
1132 return [
1133 (label, Count(value), Ratio(value, den))
1134 for label, (value, den) in object_stats.items()
1135 ]
1136
1137 return Section(
1138 "Object stats",
1139 "Allocations, frees and dict materializatons",
1140 [
1141 Table(
1142 ("", "Count:", "Ratio:"),
1143 calc_object_stats_table,
1144 JoinMode.CHANGE,
1145 )
1146 ],
1147 doc="""
1148 Below, "allocations" means "allocations that are not from a freelist".
1149 Total allocations = "Allocations from freelist" + "Allocations".
1150
1151 "Inline values" is the number of values arrays inlined into objects.
1152
1153 The cache hit/miss numbers are for the MRO cache, split into dunder and
1154 other names.
1155 """,
1156 )
1157
1158
1159def gc_stats_section() -> Section:

Callers 1

summarize_stats.pyFile · 0.85

Calls 2

SectionClass · 0.70
TableClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…