Reverting the incremental GC in Python 3.14 and 3.15

I would like to follow up on Tim Peters’ comment.

At my company we use Python for game backend development, specifically as a scripting language for a server metagame engine, i.e. handling logins, game accounts, matchmaking, arenas, etc.

Due to our specifics, we have a number of Python objects that live long enough (hours, days, weeks). We don’t operate in a http-server-like reply-response manner, but rather we have actors that operate inside the cluster, and these actors are long-lived (e.g. actor for a connected player, actor for a running arena, etc.).

These long-lived actors affect the Python garbage collector, and in return the garbage collector heavily affects the overall performance of our game cluster. Max GC pauses are so significant that it became the main factor in how we choose the number of entities we can process on a single node.

In our tests, Incremental GC showed a significant performance improvement. Hence why we were very saddened by the decision to revert it.

On the chart below you can see average GC pauses with incremental GC (green) and without it after the revert (yellow).

The max GC time comparison is even more extreme; with the old GC pauses can reach up to 3 seconds, while the new incremental GC is unnoticeable.

(I am sorry I have to use an external site for image, I am not allowed to upload here)

With the old generational GC we can handle up to 10 000 actors on a single node; with the incremental GC we easily increased this number up to 30 000 actors. Also, we didn’t encounter any memory leaks in our scenarios.

We would really appreciate having some sort of switch to enable the incremental GC back. If there is something we can help with, please let me know.

31 Likes