Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b46494

Browse files
committed
Add stats for marking
1 parent 7e920d6 commit 0b46494

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ print_gc_stats(FILE *out, GCStats *stats)
231231
fprintf(out, "GC[%d] collections: %" PRIu64 "\n", i, stats[i].collections);
232232
fprintf(out, "GC[%d] object visits: %" PRIu64 "\n", i, stats[i].object_visits);
233233
fprintf(out, "GC[%d] objects collected: %" PRIu64 "\n", i, stats[i].objects_collected);
234+
fprintf(out, "GC[%d] objects reachable from roots: %" PRIu64 "\n", i, stats[i].objects_transitively_reachable);
235+
fprintf(out, "GC[%d] objects not reachable from roots: %" PRIu64 "\n", i, stats[i].objects_not_transitively_reachable);
234236
}
235237
}
236238

Tools/scripts/summarize_stats.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,8 @@ def calc_gc_stats(stats: Stats) -> Rows:
11181118
Count(gen["collections"]),
11191119
Count(gen["objects collected"]),
11201120
Count(gen["object visits"]),
1121+
Count(gen["objects reachable from roots"]),
1122+
Count(gen["objects not reachable from roots"]),
11211123
)
11221124
for (i, gen) in enumerate(gc_stats)
11231125
]
@@ -1127,7 +1129,8 @@ def calc_gc_stats(stats: Stats) -> Rows:
11271129
"GC collections and effectiveness",
11281130
[
11291131
Table(
1130-
("Generation:", "Collections:", "Objects collected:", "Object visits:"),
1132+
("Generation:", "Collections:", "Objects collected:", "Object visits:",
1133+
"Reachable from roots:", "Not reachable from roots:"),
11311134
calc_gc_stats,
11321135
)
11331136
],

0 commit comments

Comments
 (0)