Problem
Current watcher storage (DeltaFIFO/TTL) retains full event objects and fires handler callbacks for every add/update. Under heavy churn, this increases memory pressure and CPU overhead, especially when the sink only needs a subset of fields.
Proposed optimization
Use a SharedInformer with WithTransform to drop unused fields before objects are cached/processed, or implement a minimal store that retains only the fields needed for log entry creation. This reduces object size and avoids holding large event payloads in memory.
Notes / references
Acceptance criteria
- Event objects stored/queued contain only required fields for log entry creation.
- Memory usage under high event volume decreases vs. current storage.
- Functional behavior (log payloads) remains unchanged.
Problem
Current watcher storage (
DeltaFIFO/TTL) retains full event objects and fires handler callbacks for every add/update. Under heavy churn, this increases memory pressure and CPU overhead, especially when the sink only needs a subset of fields.Proposed optimization
Use a
SharedInformerwithWithTransformto drop unused fields before objects are cached/processed, or implement a minimal store that retains only the fields needed for log entry creation. This reduces object size and avoids holding large event payloads in memory.Notes / references
WithTransform: https://pkg.go.dev/k8s.io/client-go/informers#WithTransformAcceptance criteria