Skip to content

perf(xid_correlation): lower allocs/event from 12.4 toward NORTHSTAR (2) #417

Description

@trilamsr

Tracks per-detector alloc optimization toward NORTHSTAR (2 allocs/event) for
xid_correlation. Current ceiling in scripts/bench-registry.sh::allocs_gate
is 13 allocs/event (measured 12.40 ev, 12699 allocs/op @ window=1024).
The target is ≤2 to converge on NORTHSTAR alongside the other detectors.

What the bench measures

./bench/detectors/BenchmarkXidCorrelationDetector — 64 Xid records × 1024
pod-eviction events, joined by node + time. One verdict per evicted pod
(most-recent Xid wins). See bench/detectors/detectors_bench_test.go.

Hot-path candidates (pre-investigation)

  • One verdict allocated per evicted pod (~819 pods); verdict structs +
    evidence trail dominate the allocation count.
  • Per-pod string formatting for evidence strings.
  • ObjectRef Pod-kind allocation per event.

Definition of done

  • Lower the ceiling in scripts/bench-registry.sh::allocs_gate to the new
    floor (the absolute gate prevents creep back upward).
  • Update bench/detectors/baselines.json for the soft-gate trend tracking.
  • Profile-driven (go test -bench=BenchmarkXidCorrelationDetector -memprofile)
    — fix the largest contributor, re-measure, repeat.

Why now (priority signal)

Above NORTHSTAR by ~6×. Highest leverage of the remaining gap (along with
pod_evicted, which is tracked separately).

Rolls up to #302.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions