
The full release of CPython 3.13 has been delayed by a week in order to remove the incremental garbage collector (GC), following reports that it caused slowdowns, despite the change being intended to speed performance.
CPython core developer Thomas Wouters posted about his concern with “the impact of the incremental GC change in 3.13,” adding that “it’s not clear that the incremental GC provides significant improvements (although the smaller pauses are probably desirable), it clearly has slightly more overhead in common cases, and we’re still discovering pathological cases.”
Although removing it at this very late stage is “a drastic change,” Wouters argued that a new release candidate (without the incremental GC) and delaying the release of 3.13 by one week would be sufficient. “We’re rolling back to known old code, which is less risky than attempting to work around the pathological cases in the new code,” he said.
The new incremental GC currently remains in the code for CPython 3.14, scheduled for around this time next year, though Wouters has doubts, saying “we need a bit more of a value proposition for the change.”
Microsoft’s Mark Shannon, tech lead of the Faster CPython team, proposed the feature in August last year, stating: “The current GC is both inefficient and can have very long pause times… we should use an incremental collector, it can improve efficiency and hugely reduce maximum pause times.”
The trigger for its removal was a performance regression in Sphinx, which is a documentation tool which is used by the Python team. With Python 3.13, the time to build Sphinx increased from around 1.28 seconds to around 1.80 seconds, and the time to build the CPython documentation with Sphinx increased from 45.5 seconds to 62.7 seconds. Reverting the incremental GC has fixed the problem.
Another core developer, Neil Schemenauer noted that changed to the GC are inherently likely to speed some programs and slow down others. In addition, “it could cause them to use more or less memory. Or, to more or less quickly free resources like file descriptors and sockets.”
A problem with the release process is that relatively few people try the release candidates, so it is hard to gauge the overall impact of a change that has mixed results like this. “We don’t have a good sense if those [slowdowns] are rare cases or common. Giving it time to mature more in the 3.14 branch is the cautious approach and I think that’s a good decision,” said Schemenauer.
In some cases, reverting the incremental GC has slightly slowed performance, for example as reported by another developer, particularly on macOS.