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

ExtendFOR_ITER specializations to cover other indexable sequences #145668

Open
Labels
3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage
@markshannon

Description

@markshannon

Currently, we specializeFOR_ITER for both tuple and list. We also handle tuple and lists specially inGET_ITER to support this specialization.

We should extend this specialization of iteration over sequences, using virtual iterators tobytes,str,bytesarray and others.
To do this, we should:

  • Add atp_getiteritem slots toPyTypeObject for sequences that can be efficiently indexed and cannot raise except for out-of-bounds access.
  • Add a specialization ofFOR_ITER for these classes.
  • SpecializeGET_ITER for:
    • iterators
    • indexable sequences (those classes with atp_getiteritem slot)
  • SpecializeSEND for indexable sequences which should also improve JIT coverage, as unspecialized_SEND is currently a major cause of jit optimization failures.

Combined with#145667 this will allow effective specialization of a wider range of iterables and allow that specialization not only forfor loops, but also foryield from loops.
It will add 3 instructions (4 new, 1 removed) which a reasonable

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp