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: Use per-thread slice_cache in free-threading by corona10 · Pull Request #113972 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Jan 12, 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: Use per-thread slice_cahce in free-threading
b05b359
@corona10 corona10 added the skip news label Jan 12, 2024
@corona10
corona10 requested review from colesbury and erlend-aasland January 12, 2024 00:58
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 12, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jan 12, 2024
Use per-thread freelists in --disable-gil builds #111968
Closed
@corona10 corona10 added topic-free-threading and removed awaiting core review labels Jan 12, 2024
@corona10 corona10 changed the title gh-111968: Use per-thread slice_cahce in free-threading gh-111968: Use per-thread slice_cache in free-threading Jan 12, 2024
corona10
corona10 commented Jan 12, 2024
View reviewed changes
Comment thread Include/internal/pycore_freelist.h
struct _Py_tuple_state tuple_state;
struct _Py_list_state list_state;
struct _Py_slice_state slice_state;
} _PyFreeListState;

@corona10 corona10 Jan 12, 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.

@erlend-aasland @colesbury
IMO, we should rename _PyFreeListState if we consider slice_cache is not freelist :)
Do you have any good suggestion?

Sorry, something went wrong.

Uh oh!

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

All reactions

@colesbury colesbury Jan 12, 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.

It's basically a freelist of max-length 1 🤷

Sorry, something went wrong.

Uh oh!

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

corona10 reacted with laugh emoji
All reactions
  • 😄 1 reaction

@corona10 corona10 Jan 12, 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.

In that case, let's maintain the current naming. (Changing is quite stressful)

Sorry, something went wrong.

Uh oh!

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

All reactions
colesbury
colesbury reviewed Jan 12, 2024
View reviewed changes
Comment thread Objects/sliceobject.c
}

void _PySlice_Fini(PyInterpreterState *interp)
void _PySlice_Fini(_PyFreeListState *state)

@colesbury colesbury Jan 12, 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.

This is identical to _PySlice_ClearCache. Do we need both functions? If you want to keep both names, maybe have one call the other.

Sorry, something went wrong.

Uh oh!

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

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@corona10 corona10 Jan 12, 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.

Let's keep both names; I don't want to confuse people who work on the default build.

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
struct _Py_tuple_state tuple_state;
struct _Py_list_state list_state;
struct _Py_slice_state slice_state;
} _PyFreeListState;

@colesbury colesbury Jan 12, 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.

It's basically a freelist of max-length 1 🤷

Sorry, something went wrong.

Uh oh!

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

corona10 reacted with laugh emoji
All reactions
  • 😄 1 reaction
@corona10
Address code review
ac5cdb8
@corona10
corona10 requested a review from colesbury January 12, 2024 16:54
@erlend-aasland

erlend-aasland commented Jan 14, 2024

Copy link
Copy Markdown
Contributor

I'll defer to Sam; please take his comments into account :)

All reactions

Sorry, something went wrong.

Uh oh!

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

colesbury
colesbury approved these changes Jan 15, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 15, 2024
@corona10
corona10 merged commit 3eae765 into python:main Jan 15, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Jan 15, 2024
@corona10
corona10 deleted the gh-111968-slice branch January 15, 2024 15:39
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
@corona10 @kulikjak
pythongh-111968: Use per-thread slice_cache in free-threading (python…
9aa116b
…gh-113972)
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@corona10 @aisk
pythongh-111968: Use per-thread slice_cache in free-threading (python…
809d58f
…gh-113972)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@corona10 @Glyphack
pythongh-111968: Use per-thread slice_cache in free-threading (python…
de68319
…gh-113972)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@colesbury colesbury colesbury approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland

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 @erlend-aasland @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 01402520 — 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.