Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.13] GH-124567: Revert the Incremental GC in 3.13 #124770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "[3.13] GH-122298: Restore printing of GC stats (GH-123261) (#…
…123268)"

This reverts commit b1372e2.
  • Loading branch information
Yhg1s committed Sep 29, 2024
commit 8e9333e00f75b71e0eea3947ac397ac2f9ded051
25 changes: 0 additions & 25 deletions 25 Python/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,6 @@ gc_collect_young(PyThreadState *tstate,
GCState *gcstate = &tstate->interp->gc;
PyGC_Head *young = &gcstate->young.head;
PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head;
GC_STAT_ADD(0, collections, 1);
#ifdef Py_STATS
{
Py_ssize_t count = 0;
Expand Down Expand Up @@ -1418,7 +1417,6 @@ completed_cycle(GCState *gcstate)
static void
gc_collect_increment(PyThreadState *tstate, struct gc_collection_stats *stats)
{
GC_STAT_ADD(1, collections, 1);
GCState *gcstate = &tstate->interp->gc;
PyGC_Head *not_visited = &gcstate->old[gcstate->visited_space^1].head;
PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head;
Expand Down Expand Up @@ -1464,7 +1462,6 @@ static void
gc_collect_full(PyThreadState *tstate,
struct gc_collection_stats *stats)
{
GC_STAT_ADD(2, collections, 1);
GCState *gcstate = &tstate->interp->gc;
validate_old(gcstate);
PyGC_Head *young = &gcstate->young.head;
Expand Down Expand Up @@ -1787,24 +1784,6 @@ PyGC_IsEnabled(void)
return gcstate->enabled;
}

// Show stats for objects in each generations
static void
show_stats_each_generations(GCState *gcstate)
{
char buf[100];
size_t pos = 0;

for (int i = 0; i < NUM_GENERATIONS && pos < sizeof(buf); i++) {
pos += PyOS_snprintf(buf+pos, sizeof(buf)-pos,
" %zd",
gc_list_size(GEN_HEAD(gcstate, i)));
}
PySys_FormatStderr(
"gc: objects in each generation:%s\n"
"gc: objects in permanent generation: %zd\n",
buf, gc_list_size(&gcstate->permanent_generation.head));
}

Py_ssize_t
_PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
{
Expand All @@ -1820,10 +1799,6 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
if (reason != _Py_GC_REASON_SHUTDOWN) {
invoke_gc_callback(gcstate, "start", generation, &stats);
}
if (gcstate->debug & _PyGC_DEBUG_STATS) {
PySys_WriteStderr("gc: collecting generation %d...\n", generation);
show_stats_each_generations(gcstate);
}
if (PyDTrace_GC_START_ENABLED()) {
PyDTrace_GC_START(generation);
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.