JIT: Optimize common C calls via replication #133020
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
topic-JIT
type-feature
A feature request or enhancement
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
Currently, a C calls is executed roughly as follows in the specializing interpreter:
This has two sources of overhead:
We can optimize it to the following in the JIT:
LOOKUP_TABLE
will be populated with common C functions that we know Python code uses.This will remove the overhead of 2. Allowing the JIT to inline and optimize these calls.
If we want, there's an even more extreme optimization we could do. We could just burn in the C function directly and call it. saving the overhead of 1. However, I don't think this could be done without breaking strange usages of
ml_meth
where it's dynamically set. So I would be more cautious here with that.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
The text was updated successfully, but these errors were encountered: