#[repr(u8)]pub enum CacheId {
AutorouteDecision = 0,
AutorouteCalibration = 1,
IncrementalUnchanged = 2,
MatcherArtifact = 3,
VerifierResult = 4,
HyperscanShard = 5,
GpuProgram = 6,
DetectorPlan = 7,
}Expand description
A reuse cache the profiler reports hit and miss counts for.
Every KeyHog cache that exists to avoid repeating work reports through this
one enum, so “what is our cache hit rate” has a single answer instead of one
per subsystem. Record every consultation with exactly one of
crate::record_cache_hit or crate::record_cache_miss, so the reported
rate has a real denominator.
Counters are indexed by CacheId::index into a fixed array of length
CacheId::COUNT, so recording is one relaxed atomic add with no
allocation and no lookup on the hot path.
Variants§
AutorouteDecision = 0
Persisted autoroute backend decision reused instead of re-deciding. A miss means the scan runs without a calibrated route.
AutorouteCalibration = 1
Autoroute calibration measurement reused instead of re-measuring.
IncrementalUnchanged = 2
Chunk skipped because the incremental scan judged it unchanged.
MatcherArtifact = 3
Compiled matcher artifact reused instead of recompiled. This is the cache standing between a scan and the engine-initialization cost.
VerifierResult = 4
Credential verification result reused instead of re-requested. A miss costs a network round trip, so this rate is also a rate-limit story.
HyperscanShard = 5
Hyperscan compiled regex shard database reused from disk cache.
GpuProgram = 6
Compiled GPU literal-set binary matcher reused from disk cache.
DetectorPlan = 7
Pre-parsed detector JSON execution plan reused from cache.