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

Function iter_optimization_tables

Tools/scripts/summarize_stats.py:1282–1355  ·  view source on GitHub ↗
(base_stats: Stats, head_stats: Stats | None = None)

Source from the content-addressed store, hash-verified

1280 )
1281
1282 def iter_optimization_tables(base_stats: Stats, head_stats: Stats | None = None):
1283 if not base_stats.get_optimization_stats() or (
1284 head_stats is not None and not head_stats.get_optimization_stats()
1285 ):
1286 return
1287
1288 yield Table(("", "Count:", "Ratio:"), calc_optimization_table, JoinMode.CHANGE)
1289 yield Table(("", "Count:", "Ratio:"), calc_optimizer_table, JoinMode.CHANGE)
1290 yield Section(
1291 "JIT memory stats",
1292 "JIT memory stats",
1293 [
1294 Table(
1295 ("", "Size (bytes):", "Ratio:"),
1296 calc_jit_memory_table,
1297 JoinMode.CHANGE
1298 )
1299 ],
1300 )
1301 yield Section(
1302 "JIT trace total memory histogram",
1303 "JIT trace total memory histogram",
1304 [
1305 Table(
1306 ("Size (bytes)", "Count", "Ratio:"),
1307 calc_histogram_table("Trace total memory size"),
1308 JoinMode.CHANGE_NO_SORT,
1309 )
1310 ],
1311 )
1312 for name, den in [
1313 ("Trace length", "Optimization traces created"),
1314 ("Optimized trace length", "Optimization traces created"),
1315 ("Trace run length", "Optimization traces executed"),
1316 ]:
1317 yield Section(
1318 f"{name} histogram",
1319 "",
1320 [
1321 Table(
1322 ("Range", "Count:", "Ratio:"),
1323 calc_histogram_table(name, den),
1324 JoinMode.CHANGE_NO_SORT,
1325 )
1326 ],
1327 )
1328 yield Section(
1329 "Uop execution stats",
1330 "",
1331 [
1332 Table(
1333 ("Name", "Count:", "Self:", "Cumulative:", "Miss ratio:"),
1334 calc_execution_count_table("uops"),
1335 JoinMode.CHANGE_ONE_COLUMN,
1336 )
1337 ],
1338 )
1339 yield pair_count_section(prefix="uop", title="Non-JIT uop")

Callers

nothing calls this directly

Calls 6

calc_histogram_tableFunction · 0.85
pair_count_sectionFunction · 0.85
TableClass · 0.70
SectionClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…