◐ Shell
clean mode source ↗

gh-100240: Use a consistent implementation for freelists by colesbury · Pull Request #121934 · python/cpython

Conversation

@colesbury

@colesbury colesbury commented

Jul 17, 2024

edited by bedevere-app Bot

Loading

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.

@colesbury

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.

@markshannon

Perfomance is in the noise but doesn't look like it's any worse.

markshannon

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.

corona10

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 :)

Co-authored-by: Mark Shannon <mark@hotpy.org>

@colesbury

!buildbot AMD64 Ubuntu NoGIL Refleaks

@bedevere-bot

🤖 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

Reviewers

@corona10 corona10 corona10 approved these changes

@markshannon markshannon markshannon approved these changes

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

@methane methane Awaiting requested review from methane methane is a code owner

@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner

@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner

Labels