Skip to content

Conversation

@corona10
Copy link
Member

@corona10corona10 commented May 17, 2024

@corona10corona10 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
@corona10corona10 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
@corona10corona10 requested review from colesbury and mpageMay 17, 2024 06:48
@corona10corona10 marked this pull request as ready for review May 17, 2024 06:48
@corona10corona10 requested a review from mpageMay 18, 2024 10:16
Copy link
Contributor

@mpagempage left a 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.

@colesburycolesbury added needs backport to 3.13 bugs and security fixes labels May 20, 2024
@corona10corona10 merged commit ab4263a into python:mainMay 21, 2024
@miss-islington-app
Copy link

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!

@corona10corona10 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
…gh-119112) (cherry picked from commit ab4263a) Co-authored-by: Donghee Na <donghee.na@python.org>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label May 21, 2024
corona10 added a commit that referenced this pull request May 21, 2024
…9112) (gh-119309) gh-119053: Implement the fast path for list.__getitem__ (gh-119112) (cherry picked from commit ab4263a) Co-authored-by: Donghee Na <donghee.na@python.org>
@JelleZijlstraJelleZijlstra mentioned this pull request May 28, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@corona10@mpage@colesbury