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-119053: Implement the fast path for list.__getitem__ by corona10 · Pull Request #119112 · python/cpython

Conversation

@corona10

@corona10 corona10 commented May 17, 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: Implement the fast path for list.__getitem__ #119053

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10 corona10 added skip news topic-free-threading labels May 17, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 17, 2024
Implement the fast path for list.__getitem__ #119053
Closed
@corona10 corona10 changed the title gh-119053: Implement the fast path for list.__getitem__ [WIP] gh-119053: Implement the fast path for list.__getitem__ May 17, 2024
@corona10
corona10 force-pushed the gh-119053 branch from 1c15fb2 to 5fb201d Compare May 17, 2024 06:01
@corona10
pythongh-119053: Implement the fast path for list.__getitem__
f895ca9
@corona10
corona10 force-pushed the gh-119053 branch from b33df59 to f895ca9 Compare May 17, 2024 06:24
corona10 added 4 commits May 17, 2024 02:27
@corona10
fix
8b96ae2
@corona10
nit
8e832e0
@corona10
nit
b6ac85f
@corona10
fix
c451a5d
@corona10 corona10 changed the title [WIP] gh-119053: Implement the fast path for list.__getitem__ gh-119053: Implement the fast path for list.__getitem__ May 17, 2024
@corona10
corona10 requested review from colesbury and mpage May 17, 2024 06:48
@corona10
corona10 marked this pull request as ready for review May 17, 2024 06:48
@bedevere-app bedevere-app Bot added the awaiting core review label May 17, 2024
corona10
corona10 commented May 17, 2024
View reviewed changes
Comment thread Objects/listobject.c Resolved

Uh oh!

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

mpage
mpage reviewed May 17, 2024
View reviewed changes
Comment thread Objects/listobject.c Resolved

Uh oh!

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

@corona10
corona10 requested a review from mpage May 18, 2024 10:16
@corona10
Address code review
5ae49e3
mpage
mpage approved these changes May 18, 2024
View reviewed changes

@mpage mpage left a comment •
edited
Loading

Uh oh!

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

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 looks good to me. I noticed that we perform a validity check on the index several times now:

  1. In list_item
  2. In list_get_item_ref
  3. In list_item_impl (if we end up taking the slow path)

While this doesn't affect correctness, I think it would make sense to refactor the code to eliminate the redundant checks given how performance sensitive this code is. That could be tackled in a separate PR, though.

Sorry, something went wrong.

Uh oh!

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

All reactions
colesbury
colesbury reviewed May 18, 2024
View reviewed changes
Comment thread Objects/listobject.c Resolved

Uh oh!

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

corona10 added 2 commits May 18, 2024 17:57
@corona10
Merge remote-tracking branch 'upstream/main' into pythongh-119053
0e22983
@corona10
Raise index error if the item is NULL;
7fd2126
@colesbury colesbury added needs backport to 3.13 only security fixes labels May 20, 2024
colesbury
colesbury approved these changes May 20, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 20, 2024
@corona10
corona10 merged commit ab4263a into python:main May 21, 2024
@miss-islington-app

miss-islington-app Bot commented May 21, 2024

Copy link
Copy Markdown

Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label May 21, 2024
@corona10
corona10 deleted the gh-119053 branch May 21, 2024 13:49
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2024
@corona10 @miss-islington
pythongh-119053: Implement the fast path for list.__getitem__ (python…
11f687f
…gh-119112)

(cherry picked from commit ab4263a)

Co-authored-by: Donghee Na <[email protected]>
@bedevere-app

bedevere-app Bot commented May 21, 2024

Copy link
Copy Markdown

GH-119309 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label May 21, 2024
corona10 added a commit that referenced this pull request May 21, 2024
@miss-islington @corona10
[3.13] gh-119053: Implement the fast path for list.__getitem__ (gh-11…
dcb8030
…9112) (gh-119309)

gh-119053: Implement the fast path for list.__getitem__ (gh-119112)
(cherry picked from commit ab4263a)

Co-authored-by: Donghee Na <[email protected]>
@JelleZijlstra JelleZijlstra mentioned this pull request May 28, 2024
backport a9a74da 3.13 #119642
Closed
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@corona10 @estyxx
pythongh-119053: Implement the fast path for list.__getitem__ (python…
efafae7
…gh-119112)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mpage mpage mpage approved these changes
@colesbury colesbury colesbury approved these changes

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 @mpage @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.