Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-132554: Add stats for GET_ITER#132592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
markshannon merged 3 commits intopython:mainfromfaster-cpython:get-iter-stats
Apr 29, 2025

Conversation

markshannon
Copy link
Member

@markshannonmarkshannon commentedApr 16, 2025
edited
Loading

Before we can specializeGET_ITER, or even decide if it is worth specializingGET_ITER, we need stats.

@brandtbucher
Copy link
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 wheretp->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, ifGET_ITER encounters alist_iterator,range_iterator, ortuple_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.)

@markshannonmarkshannon merged commit622300b intopython:mainApr 29, 2025
63 checks passed
@markshannonmarkshannon deleted the get-iter-stats branchApril 29, 2025 08:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@markshannon@brandtbucher@iritkatriel

[8]ページ先頭

©2009-2025 Movatter.jp