8000 Split hot and cold parts of the templates. · Issue #116422 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div itemscope itemtype="http://schema.org/SoftwareSourceCode" class="">

Split hot and cold parts of the templates. #116422

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&rdq 8000 uo;, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #115802
markshannon opened this issue Mar 6, 2024 · 4 comments
Closed
Tracked by #115802

Split hot and cold parts of the templates. #116422

markshannon opened this issue Mar 6, 2024 · 4 comments
Assignees
Labels
3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@markshannon
Copy link
Member
markshannon commented Mar 6, 2024
@markshannon
Copy link
Member Author

In order to split out the cold parts of instructions we will need to support jumps within executors.
Something like:

tier2 op(_JUMP_TIER2, (offset/4 --)) {
    JUMP_BY(offset);
}

@brandtbucher How much effort to support this in the JIT?
I assume not that much as the prototype must have supported _POP_JUMP_IF_FALSE.

@brandtbucher
Copy link
Member
brandtbucher commented Mar 6, 2024

Not hard. We already loop once to get the total size before compiling, so collecting offsets during that same step isn't difficult.

@brandtbucher
Copy link
Member

And yeah, the prototype already did this at one point back when we had exit stubs.

@brandtbucher
Copy link
Member
brandtbucher commented Mar 6, 2024

Maybe not worth pursuing yet, but just realized: if we make all jumps backwards (meaning, put cold stubs before the entry point) then we can emit the entire thing in one forward pass once we have a slab allocator. But probably more trouble than it's worth right now.

@brandtbucher brandtbucher self-assigned this Mar 6, 2024
@brandtbucher brandtbucher added performance Performance or resource usage interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.13 bugs and security fixes labels Mar 6, 2024
markshannon added a commit that referenced this issue Mar 15, 2024
vstinner pushed a commit to vstinner/cpython that referenced this issue Mar 20, 2024
vstinner pushed a commit to vstinner/cpython that referenced this issue Mar 20, 2024