I participate in the Codex OSS Program, but I end up with a lot of unused AI credits every week. So I decided to have the latest model explore some ideas that I had been interested in but hadn’t been able to investigate due to my limited knowledge and time.
This pull request replaces Python’s reference counting with a tracing GC and was then optimized over the course of several days.
https://github.com/methane/cpython/pull/125
The results may not be particularly exciting. Python performs a large number of allocations and deallocations, and the immediate reuse enabled by reference counting is a very powerful advantage. It was not easy to optimize the tracing GC enough to outperform reference counting.
This file contains a report written by Codex itself, including an overview of the implemented optimizations and performance comparisons.
Let me know if there is anything else you would like Codex to try. For example, it can look through old issues and identify ones that are likely ready to be closed.