()
| 1157 | |
| 1158 | |
| 1159 | def gc_stats_section() -> Section: |
| 1160 | def calc_gc_stats(stats: Stats) -> Rows: |
| 1161 | gc_stats = stats.get_gc_stats() |
| 1162 | |
| 1163 | return [ |
| 1164 | ( |
| 1165 | Count(i), |
| 1166 | Count(gen["collections"]), |
| 1167 | Count(gen["objects collected"]), |
| 1168 | Count(gen["object visits"]), |
| 1169 | Count(gen["objects reachable from roots"]), |
| 1170 | Count(gen["objects not reachable from roots"]), |
| 1171 | ) |
| 1172 | for (i, gen) in enumerate(gc_stats) |
| 1173 | ] |
| 1174 | |
| 1175 | return Section( |
| 1176 | "GC stats", |
| 1177 | "GC collections and effectiveness", |
| 1178 | [ |
| 1179 | Table( |
| 1180 | ("Generation:", "Collections:", "Objects collected:", "Object visits:", |
| 1181 | "Reachable from roots:", "Not reachable from roots:"), |
| 1182 | calc_gc_stats, |
| 1183 | ) |
| 1184 | ], |
| 1185 | doc=""" |
| 1186 | Collected/visits gives some measure of efficiency. |
| 1187 | """, |
| 1188 | ) |
| 1189 | |
| 1190 | |
| 1191 | def optimization_section() -> Section: |
no test coverage detected
searching dependent graphs…