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

Remove_DYNAMIC_EXIT #129715

Open
Open
Assignees
brandtbucher
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JITtype-featureA feature request or enhancement
@brandtbucher

Description

@brandtbucher

Looking at the latest benchmarking comparison forJIT on vs. JIT off, we currently have a number of benchmarks that are slowed down significantly, with 16 benchmarks slowing down over 5%, 3 slowing down over 15%, and one (generators) slowing down over 25%. Clearly, there are some code patterns that we just aren't handling well. If we want people to turn on the JIT, we need to minimize this potential downside.

It appears the culprit is, well, generators. In particular,_DYNAMIC_EXIT. Long story short, I think we should ditch_DYNAMIC_EXIT, at least for now. It was always a bit of a not-quite-complete solution to a hard tracing problem, andgetting rid of it is enough to cancel out the slowdown on all of our slowest benchmarks (only 10 benchmarks are slowed down more than 5%, and none slowed down more than 10%).

We use_DYNAMIC_EXIT for a couple of code patterns:

  • Tracing into a generator, viaFOR_ITER_GEN orSEND_GEN. This will no longer successfully project a trace.
  • Tracing into a function, viaLOAD_ATTR_PROPERTY orBINARY_SUBSCR_GETITEM. These caches actually have the necessary information to continue tracing, so_DYNAMIC_EXIT isn't really needed anymore.
  • Tracing into a function that isn't in the reverse-lookup-by-version cache, which should be uncommon.

We may also want to fail to create traces that end inYIELD_VALUE, but that can be considered separately as a follow up.

Once this is done, we can work on a new solution for tracing generators that's more robust (perhaps by using normal side exits, and starting each trace with a guard on the instruction pointer). We should probably only merge a solution once it's proven to work in practice, since the JIT is beginning to mature and stabilize.

(Thanks@mdboom for the idea.)

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JITtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp