Skip to content

Faster side exits via jump patching #140434

@Fidget-Spinner

Description

@Fidget-Spinner

Feature or enhancement

Proposal:

So I have another idea: I noticed side exits are extremely slow on our JITted code. I suspect the main reason is that it has 2 jumps to a side exit (one to the jump target, one tail call thru the executor). So much so that having any side exit in the hot path slows things down tremendously. I realised the JIT knows offsets to the side exit jump patches.

So I think I can implement a small little helper in the executor to rewrite the side exits from 2 jumps to 1 jump after _COLD_EXECUTOR gets hot. It would need to mmap the page again from R^X to W then back to R^X but from pypy's experience it should be worth it.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Labels

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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions