gh-100240: Use a consistent implementation for freelists by colesbury · Pull Request #121934 · python/cpython
Conversation
This combines and updates our freelist handling to use a consistent implementation. Objects in the freelist are linked together using the first word of memory block. If configured with freelists disabled, these operations are essentially no-ops.
I'm putting this up for discussion and feedback.
@markshannon, this doesn't do all the things listed in the issue -- I haven't
changed the capacity of the freelists and they're still separated by type --
but it removes a lot of duplicated code.
In my limited testing, I haven't seen a significant performance difference.
Perfomance is in the noise but doesn't look like it's any worse.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. +290 −700 had me sold 🙂
A lot of compiler warnings, but should be fixable with one cast in the _Py_FREELIST_SIZE macro.
Consider it approved once the macro is fixed.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Consider it approved once the macro is fixed.
Same opinion :)
🤖 New build scheduled with the buildbot fleet by @colesbury for commit aa8e4d5 🤖
The command will test the builders whose names match following regular expression: AMD64 Ubuntu NoGIL Refleaks
The builders matched are:
AMD64 Ubuntu NoGIL Refleaks PR