Skip to content

perf: screen the simple untargeted dispatch hot path #501

Description

Part of #497 and #414.

Inputs and dependencies

Exploration may begin earlier. Production confirmation waits for #506, #508, #509, and #510. A named native-cost claim also waits for #511.

Purpose

Decompose and reduce fixed cost in the simple untargeted class and struct route without weakening the dynamic public contract.

Owned experiments

  • Screen sweep-gate, plan lookup/validation, dispatch lease, emission/tick/touch stores, diagnostics/debug branches, live activity, reset polling, token callback augmentation, casts, callback ABI, and 0/1/N shape.
  • Use a class control, the exact Research MessagePipe performance targets and formal parity for 4.0.0 #414 comparison struct, and readonly 0/16/64/256-byte structs at 0, 1, and 16 handlers.
  • Use a secondary 1/2/4/8-machine-word ABI matrix only to locate calling-convention transitions.
  • Compare by-value and readonly-in callbacks across monomorphic and heterogeneous targets.
  • Test relevance-scoped plan epochs with hot type A plus unrelated type-B churn.
  • Test guided lease code shape only if perf lab: resolve IL2CPP cost with WPR, PMU, and native maps #511 places an interval-supported material share in lease handling.
  • Compare the current generic-static message index and route lookup with an explicit resolved type index, bus-bound prepared emitter, and generated closed bus-local leaf.
  • Stop a resolved-type or generated candidate when native output shows no class-init, RGCTX, cast, cache, or bounds cost to remove.
  • Compare the current lazy first-post-mutation rebuild with eager immutable publication for the simple scalar route. perf: screen route-plan data structures and middleware pipelines #503 owns keyed and middleware extension.
  • Test selected no-feature kernels, diagnostics mode selection, typed cached routes, hot/cold outlining, and evidence-guided entry layout.
  • Test manual prefetch or blocked traversal only at fan-out 64/256 and only after PMU evidence.

WPR capture, PMU collection, evidence retention, power calculation, and comparison-bridge implementation belong to the linked lab tasks.

RED and correctness

  • Add route-specific operations and observations to test: build a differential bus state-machine oracle #509.
  • Cover ordering, found results, diagnostics, exceptions, live disable/re-enable, reset during dispatch, same/cross-kind reentrancy, nested throw, deferred reset, stale prepared handles, trim, and multiple buses.
  • Prove every mutation-to-epoch mapping before scoping invalidation.
  • Prove eager publication retains the old route for the current emission and exposes the new route to the contractually correct nested or later emission.
  • Keep every affected allocation-matrix row at zero.
  • Preserve live MessageHandler.active and the per-callback reset-generation reread unless an additive frozen contract explicitly removes mutation.

Acceptance

Every screened factor receives an effect estimate and a keep, park, reject, inconclusive, invalid, or measurement-blocked decision.

A production candidate must:

Registration storage, target maps, middleware pipelines, and additive semantic modes are out of scope. Do not repeat a rejected #414 representation without a new causal reason.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions