Skip to content

JIT: optimize tiering policy, warmup, and compilation cost #481

Description

@chrisbbreuer

Parent: #459
Depends on: #461, #466, #467, #471, #480

Goal

Build a general tiering policy that minimizes time-to-performance, compile CPU, code size, invalidation churn, and warmup latency across short- and long-lived workloads.

Current boundary

The comparison harness deliberately performs ten warm calls to cross the current eight-entry optimizer threshold. That validates warmed performance but does not prove the threshold/policy is right for applications, cold work, polymorphism, shared realms, or large code.

Scope

  • Profile entry/backedge heat, loop trip count, dispatch cost, runtime-operation mix, polymorphism, allocation, deopt/invalidation history, compile cost, and expected remaining lifetime.
  • Select interpreter/VM/baseline/optimizer/OSR transitions with a bounded cost-benefit model rather than one global count.
  • Add compile queue/background compilation only if artifact claims, Context teardown, no-GIL readers, W^X, memory pressure, and deterministic tests remain exact.
  • Apply exponential backoff/cooldown to repeated rejection/deopt/invalidation based on reason, while allowing changed evidence to retry.
  • Bound compiled bytes and prioritize/evict by measured value under Memory: bound heap, cache, and executable-code footprint #480.

No-workaround rules

Acceptance

  • Bench: define the representative dependency-free performance matrix #460 reports time-to-tier, compile latency/CPU, code bytes, publications, rejects, deopts, invalidations, and steady attribution per workload.
  • Policy improves a predeclared blend of cold, warm, short, long, monomorphic, polymorphic, and no-GIL work without row-level regression.
  • Deterministic policy tests and forced-tier semantic differentials cover every transition and backoff state.
  • Compilation/publication/invalidation/teardown races pass TSan and artifact lifetime gates.
  • Full reference-host evidence includes both wall time and compile/code-memory cost.

Foundation

Tier records from #52/#431 and managed-baseline preference at df86d687.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjitBytecode, baseline JIT, optimizer, and code generationperformanceMeasured runtime, memory, scaling, or build performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions