NOTE: We now use the term

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-10-24 10:00:04

NOTE: We now use the term "The JIT" to refer to both the (a) Tier 2 micro-opcodes and optimizer and (b) machine code generator. In the past, we referred to these as (a) Tier 2 and (b) the JIT. This naming is more consistent with other runtimes.

For many references, we know that there is another reference that will outlive that reference. For these references we can either:

With improved reference counting, there are a number of reference count operations that don't change the counter. We can take advantage of that to move a bit of work into decrementing reference counts to mark possible roots of cycles. When doing cycle GC, we only need to look at these objects, not all objects, when searching for a cycle.

There are a number of small built-in functions, such as any, all, and enumerate, that are implemented in C. These functions are an obstacle to optimization as execution flows from Python to C and then back to Python. By rewriting these functions in Python, the optimizer can see across the function call boundary, so they can be better optimized.

Specializations are currently written by hand for specific built-in types that we know will have the most impact. However, some important libraries, e.g., Numpy, could benefit from participating in the specialization system by being able to cache redundant work at specific call sites.

Leave a Comment