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-132554: Add stats for GET_ITER by markshannon · Pull Request #132592 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Apr 16, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Before we can specialize GET_ITER, or even decide if it is worth specializing GET_ITER, we need stats.

  • Issue: Use tagged ints for faster iteration #132554

Sorry, something went wrong.

Uh oh!

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

All reactions
@markshannon
Add stats for GET_ITER
2dfa47c
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 16, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Apr 16, 2025
Use tagged ints for faster iteration #132554
Open
@markshannon markshannon added the skip news label Apr 16, 2025
iritkatriel
iritkatriel approved these changes Apr 16, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 16, 2025
@markshannon
Look for common iterable types, not iterator types
10cd875
@brandtbucher

brandtbucher commented Apr 16, 2025

Copy link
Copy Markdown
Member

I bet a lot of the "other" will already be iterators. It may be worth adding a stat at the end, before "other", for types where tp->tp_iter == PyObject_SelfIter. At least for that case we can specialize it and do nothing.

(I wish we could also "unwrap" list, tuple, and range iterators, similar in spirit to our method call optimization. Basically, if GET_ITER encounters a list_iterator, range_iterator, or tuple_iterator we just put the container itself and the current index on the stack. But that's not safe to do if its refcount is greater than one, unfortunately.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
Add stats for self iter and fix naming in summary
a455573
@markshannon
markshannon merged commit 622300b into python:main Apr 29, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 29, 2025
@markshannon
markshannon deleted the get-iter-stats branch April 29, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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

@markshannon @brandtbucher @iritkatriel
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.