perf(engine): cap preview push rate (~20fps) to cut per-frame resize CPU#93
Merged
Conversation
…e CPU The preview ShmWriter was fed a resized frame every captured frame (up to source fps). The UI tile is a monitoring view (overlays come from ~10Hz telemetry, not the preview), so it doesn't need full capture fps. Cap the push to 20fps, skipping the per-frame resize/copy on faster sources. Detection/tracking are unaffected (they use the full-rate frame elsewhere). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merged
TCVinNYC
added a commit
that referenced
this pull request
Jun 24, 2026
Second **pre-release** of the 2.2.0 reliability + performance roadmap, for real-hardware validation before the stable 2.2.0. Bumps `__version__` to `2.2.0-rc2`; on merge, tag `v2.2.0-rc2` triggers the pre-release installer build. **New since rc1 (all merged, CI-green + multi-agent-reviewed):** - #92 CPU subservice governor — fewer CPU spikes (phase-stagger) + cadence throttle under load - #93 preview-rate-cap (~20fps) - #90 live GPU-acceleration verdict in the Services panel - #91 OpenVINO auto-install for Intel - #94 scene-adaptive ReID threshold - #95/#96 opt-in fused TargetAssociator (off by default) - #97 batched detect_batch primitive **Validate especially:** CPU usage/spikes with all subservices running (your priority), and \`python -m autoptz --bench\` / the Services-panel verdict on Intel-Mac+AMD. To try the new tracking logic, set \`tracking.use_target_associator = true\`. Follow-ups after your validation: P4 coalescing scheduler, wire the associator ReID/pose cues + flip its default, int8 CPU quant, stable Win/Linux device binding. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CPU-perf: the worker resized and pushed a preview frame to shared memory on EVERY captured frame (up to source fps). The UI camera tile is a monitoring view — its overlays come from the ~10Hz telemetry, not the preview frame — so it does not need the full capture rate.
Caps the preview push to ~20fps (
_PREVIEW_PUSH_FPS), skipping the per-framecv2.resize/copy on >20fps sources. Detection/tracking are untouched (they consume the full-rate frame on a separate path). First frame always pushes; rate resumes after a stall.2 tests (rate cap with a controlled clock; first-frame-always-pushes). Full suite green.
CPU-perf focus item. Real savings (especially with multiple cameras) validated on the rig at the final RC.
🤖 Generated with Claude Code