Skip to content

Reduce UI recorder idle wakeups#3944

Merged
louis030195 merged 1 commit into
mainfrom
codex/more-windows-cli-cpu-optimizations
Jun 9, 2026
Merged

Reduce UI recorder idle wakeups#3944
louis030195 merged 1 commit into
mainfrom
codex/more-windows-cli-cpu-optimizations

Conversation

@louis030195

Copy link
Copy Markdown
Collaborator

Summary

  • make the UI recorder event loop compute its receive timeout from actual pending work instead of waking every 100ms while idle
  • remove the Windows element-context bridge polling loop by blocking on the UIA result channel until data or disconnect
  • downgrade hot success/skip logs (frame_linker successful pairs and content-dedup skips) from INFO to DEBUG to avoid default stdout work during normal input bursts

CPU / wakeup notes

  • UI recorder idle receive wakeups drop from 10/sec to about 1/sec when there is no pending batch or scroll-stop deadline.
  • Batch flush and scroll-stop latency are preserved by waking at the nearest pending deadline.
  • Element-context bridge idle wakeups drop from 10/sec to zero; it now wakes only on click-context messages or UIA sender disconnect.
  • Final local profile (screenpipe record, audio/telemetry/keyboard/clipboard/snapshot-compaction/meeting-detector disabled) stayed low in typing/scrolling and quieted the prior default INFO spam:
    • typing avg: 1.689% of one core
    • scrolling avg: 1.153% of one core
    • idle_post avg: 0.354% of one core

Test plan

  • cargo fmt
  • ORT_SKIP_DOWNLOAD=1 cargo test -p screenpipe-a11y platform::windows::tests::test_permission_check --lib
  • ORT_SKIP_DOWNLOAD=1 cargo test -p screenpipe-engine ui_recorder::event_batch_tests --lib
  • ORT_SKIP_DOWNLOAD=1 cargo test -p screenpipe-engine frame_linker::tests --lib
  • ORT_SKIP_DOWNLOAD=1 cargo build --release -p screenpipe-engine --bin screenpipe

@louis030195 louis030195 marked this pull request as ready for review June 9, 2026 22:32
@louis030195 louis030195 merged commit f567756 into main Jun 9, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant