Skip to content

perf: screen route-plan data structures and middleware pipelines #503

Description

Part of #497 and the filtered, post-processing, and keyed outcomes in #414. Consumes the shared-prologue baseline from #501.

Inputs and dependencies

Purpose

Measure and optimize targeted, broadcast, priority, global-accept-all, interceptor, post-processing, and rewritten-route costs without conflating them with the simple emit prologue.

Owned experiments

  • Add exact one-hook, one-post, one-plus-one, 16-keys-one-hit, one-token/four-priority, global-accept-all, targeted, broadcast, and without-context topology rows.
  • Run an orthogonal covering screen over hit/miss, cardinality, handlers, active density, priorities, hook depth, veto/rewrite rate, and churn.
  • Profile current IntKeyMap probes, load, collisions, resize, delete moves, hit/miss, key skew, cache events, and retained bytes.
  • Add sanitized Unity keys, contiguous IDs, negative/extreme IDs, power-of-two strides, aligned low bits, uniform random, Zipf access, mixer-specific collisions, and misses inside/outside clusters.
  • Screen hash mixer, load factor, probing, deletion, and layout as mechanisms instead of treating named maps as indivisible candidates.
  • Compare dynamic managed candidates: current linear/backward-shift storage, Robin Hood, scalar tagged-metadata open addressing, and standard Dictionary controls.
  • Use Swiss or F14 terminology only when native evidence proves vector control-byte group comparison. Faithful SIMD variants belong to perf: prototype frozen, batched, queued, and Burst-compatible messaging tiers #505.
  • Keep sorted vector, dense offset/page, Eytzinger, and perfect-hash candidates in frozen route work handed to perf: prototype frozen, batched, queued, and Burst-compatible messaging tiers #505.
  • Do not repeat inline 1/2/4 target maps plus ordinary spill; prior physical inline context maps failed retained storage.
  • Measure priority containers during registration, arbitrary removal, and snapshot build. Test a bitset only for an explicitly bounded priority domain with a general int fallback.
  • Test 0/1/N hook kernels, fused dynamic programs, post snapshot cost, route rewrite, global flattening, and relevance-scoped invalidation.
  • Compare AoS/SoA, packing, and numeric width only after profile/probe evidence identifies a removable cost.

RED and correctness

  • Extend test: build a differential bus state-machine oracle #509 with all affected route, hook, rewrite, priority, and context operations.
  • Audit every mutation site against its required epoch.
  • Preserve first-registration and priority order, emission-start snapshots, live activity, veto/rewrite, reset, reentrancy, and next-emission hook visibility.
  • Cover key 0, signed extremes, collision clusters, cluster deletion, resize failure, stale route handles, and full managed-reference scrubbing.
  • Keep dispatch allocation, leak, reclamation, and public-surface contracts green.

Acceptance

Every route family and data-structure mechanism receives baseline, probe/profile, allocation, retained-memory, and decision evidence.

A production winner must:

  • pass perf lab: calibrate variance, controls, power, and confirmatory inference #510, with the normal target boundary remaining greater than 3%;
  • win on a preregistered observed workload stratum rather than only an aggregate mean;
  • preserve registered p99 probe and memory limits;
  • preserve affected rows and equivalent sentinels;
  • pass independent IL2CPP confirmation, a sealed holdout, and every correctness gate;
  • record symbol, code-size, player-size, and build-time effects.

Shared prologue, compiler-only work, additive frozen semantics, and queue architecture are out of scope.

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