GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JIT/Tier 2 tracing: plans for function-entry hotness triggers (hot callbacks from C loops)? · Issue #143778 · python/cpython

JIT/Tier 2 tracing: plans for function-entry hotness triggers (hot callbacks from C loops)? #143778

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
JIT/Tier 2 tracing: plans for function-entry hotness triggers (hot callbacks from C loops)?#143778
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@113xiaoji
113xiaoji
opened on Jan 13, 2026
Issue body actions

Title: JIT/Tier 2 tracing: plans for function-entry hotness triggers (hot callbacks from C loops)?

Question

When experimenting with the experimental JIT (PEP 744), I got the impression that trace construction / compilation is primarily triggered by loop/backedge warmup (e.g. JUMP_BACKWARD backoff counters) plus side-exit temperature mechanics, rather than by “hot function entry” call counts.

If that’s correct:

  • Is this an intentional design choice for now?
  • Are there plans (or prior discussions) to support function-entry hotness triggers too?

Why I’m asking (workloads impacted)

Some real workloads execute a small Python callback many times from C-level loops, so there may be no Python-level backedge to ever warm up. Examples include:

  • sorted(..., key=callback) / list.sort(key=callback)
  • regex callbacks (re.sub(..., repl=callable))
  • some itertools / C extension APIs that repeatedly invoke a Python callable

In these cases, the callback function can be extremely hot, but a loop/backedge-only trigger would not start tracing/compilation for it.

(For reference, other runtimes/JITs (e.g. Cinder) can also trigger compilation from hot functions, not only hot loops.)

Minimal example (no Python loop)

def key(x):
    return (x * 3) ^ 0x1234

data = list(range(500_000))
sorted(data, key=key)   # key() is called many times from C

Activity

  1. 113xiaoji
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Jan 13, 2026
  2. 113xiaoji
    changed the title [-]Title: JIT: consider triggering trace recording from hot function entries (not only loop/backedge hot spots)[/-] [+]JIT: consider triggering trace recording from hot function entries (not only loop/backedge hot spots)[/+] on Jan 13, 2026
  3. 113xiaoji
    changed the title [-]JIT: consider triggering trace recording from hot function entries (not only loop/backedge hot spots)[/-] [+]JIT/Tier 2 tracing: plans for function-entry hotness triggers (hot callbacks from C loops)?[/+] on Jan 13, 2026
  4. Fidget-Spinner commented on Jan 13, 2026

    @Fidget-Spinner
    Fidget-Spinner
    on Jan 13, 2026
    Member
    More actions

    Please see #142982. We do plan to eventually trace from function entry.

  5. Fidget-Spinner
    closed this as a duplicateof JIT coverage can be improved considerably #142982 on Jan 13, 2026
  6. Fidget-Spinner commented on Mar 16, 2026

    @Fidget-Spinner
    Fidget-Spinner
    on Mar 16, 2026
    Member
    More actions

    @113xiaoji I see that you're interested in AArch64 performance?

    Right now, the 3.15 JIT benchmarks around 9-10% faster on pyperformance than tail-calling interpreter on macOS AArch64 https://doesjitgobrrr.com/.

    3.13-3.14 JIT will have mostly no speedup (in fact, negative probably) for AArch64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.