GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist by corona10 · Pull Request #115505 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Feb 15, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Use per-thread freelists in --disable-gil builds #111968

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@corona10
pythongh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist
1710e24
@corona10
corona10 requested review from ericsnowcurrently, gvanrossum, markshannon and methane as code owners February 15, 2024 08:43
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 15, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Feb 15, 2024
Use per-thread freelists in --disable-gil builds #111968
Closed
@corona10
corona10 requested a review from colesbury February 15, 2024 08:43
@corona10 corona10 added the skip news label Feb 15, 2024
@corona10 corona10 changed the title gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist [WIP[ gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist Feb 15, 2024
@corona10 corona10 changed the title [WIP[ gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist [WIP] gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist Feb 15, 2024
@corona10
corona10 force-pushed the gh-111968-dict-refactor branch from 20a4955 to 1710e24 Compare February 15, 2024 11:59
@corona10 corona10 changed the title [WIP] gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist Feb 15, 2024
@corona10

corona10 commented Feb 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@ericsnowcurrently @colesbury Ready to review!

And this is the last PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

colesbury
colesbury reviewed Feb 15, 2024
View reviewed changes
Comment thread Include/internal/pycore_freelist.h Outdated
/* Dictionary reuse scheme to save calls to malloc and free */
PyDictObject *free_list[PyDict_MAXFREELIST];
int numfree;
int keys_numfree;

@colesbury colesbury Feb 15, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need only one of numfree or keys_numfree in each struct.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently and corona10 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@corona10 corona10 Feb 15, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah copy and paste accident :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ericsnowcurrently
ericsnowcurrently requested changes Feb 15, 2024
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM

Aside from agreeing with @colesbury's point about dropping the "keys_numfree" fields, I have one mild suggestion about some local variable names (i.e. drop the "dict_"/"dictkeys_" prefix where not needed).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/internal/pycore_freelist.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/internal/pycore_freelist.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/dictobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/dictobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/dictobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/dictobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting core review labels Feb 15, 2024
@bedevere-app

bedevere-app Bot commented Feb 15, 2024

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented Feb 15, 2024

Copy link
Copy Markdown
Member

And thanks for taking the time for this PR!

corona10 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

corona10 added 2 commits February 16, 2024 05:50
@corona10
Address code review
2d7619e
@corona10
Address code review
62472aa
@corona10

corona10 commented Feb 15, 2024

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10
corona10 requested review from colesbury and ericsnowcurrently February 15, 2024 20:57
ericsnowcurrently
ericsnowcurrently approved these changes Feb 15, 2024
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adjusting that! I have just one other small suggestion.

I'm approving the PR. I'll leave it up to you about my final suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/internal/pycore_freelist.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/dictobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels Feb 15, 2024
@corona10
Address code review
1688fa7
@corona10
corona10 requested a review from 1st1 as a code owner February 16, 2024 00:26
@corona10
corona10 enabled auto-merge (squash) February 16, 2024 00:27
@corona10
corona10 merged commit 321d13f into python:main Feb 16, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 16, 2024
@corona10 corona10 added the topic-free-threading label Feb 16, 2024
@ericsnowcurrently

ericsnowcurrently commented Feb 16, 2024

Copy link
Copy Markdown
Member

Thanks again for all the great work on the freelists, @corona10!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@corona10 @diegorusso
pythongh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (…
c96dc8f
…pythongh-115505)
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
@corona10 @LukasWoodtli
pythongh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (…
6c72605
…pythongh-115505)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@gvanrossum gvanrossum Awaiting requested review from gvanrossum
@methane methane Awaiting requested review from methane methane is a code owner
@colesbury colesbury Awaiting requested review from colesbury
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-free-threading

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@corona10 @ericsnowcurrently @colesbury
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.