Skip to content

JIT coverage can be improved considerably #142982

Description

@markshannon

JIT coverage is still quite variable. For some benchmarks, e.g. richards it is close to 100%.
For others, much lower:

https://github.com/savannahostrowski/pyperf_bench/blob/main/profiling/jit.svg

Note: A fair bit of the time attributed to the interpreter is frame cleanup, so makes the interpreter fractions look larger than they are.

We can increase JIT coverage, by:

  • Treating dynamic exits, like side exits: warming up and compiling a new side trace.
  • Adding possible jit entry points at function entries, as well as backward edges.

Linked PRs

Activity

  1. Fidget-Spinner commented on Dec 23, 2025

    @Fidget-Spinner
    Member

    For context, we increased JIT coverage by 50% just with trace recording alone. This was the old chart prior to trace recording https://github.com/faster-cpython/benchmarking-public/blob/main/profiling/jit.svg

  2. self-assigned this
    on Dec 23, 2025
  3. Fidget-Spinner commented on Dec 25, 2025

    @Fidget-Spinner
    Member

    @markshannon which one have you decided to work on? I can take up this issue if you aren't too far in yet, as I don't want to touch the JIT assembly parser in #143158 :).

  4. Fidget-Spinner commented on Jan 2, 2026

    @Fidget-Spinner
    Member

    In the last pystats, CALL_FUNCTION_EX was the 3rd highest call op that called Python frames after CALL_PY_EXACT_ARGS and CALL_ALLOC_AND_ENTER_INIT https://github.com/facebookexperimental/free-threading-benchmarking/blob/main/results/bm-20251019-3.15.0a1%2B-bedaea0-JIT/bm-20251019-vultr-x86_64-python-bedaea05987738c4c6b9-3.15.0a1%2B-bedaea0-pystats.md

    We should specialize for it.

  5. Fidget-Spinner commented on Jan 3, 2026

    @Fidget-Spinner
    Member

    Things we need to specialize for:

    • CALL_FUNCTION_EX
    • SEND
    • CALL_ALLOC_AND_ENTER_INIT_SLOT

    SEND has one of the worst specialization failures of any opcode https://github.com/facebookexperimental/free-threading-benchmarking/blob/main/results/bm-20251019-3.15.0a1%2B-bedaea0-JIT/bm-20251019-vultr-x86_64-python-bedaea05987738c4c6b9-3.15.0a1%2B-bedaea0-pystats.md#send-1

    This should also speed up the interpreter slightly. It's blocking us optimizing generators/frames in the JIT.

  6. added a commit that references this issue on Jan 6, 2026
  7. added a commit that references this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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