Skip to content

perf: hot-path micro fixes in the render loop#403

Open
ChuckBuilds wants to merge 1 commit into
mainfrom
perf/hot-path-micro
Open

perf: hot-path micro fixes in the render loop#403
ChuckBuilds wants to merge 1 commit into
mainfrom
perf/hot-path-micro

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Summary

PR 3 of the performance series. Three small render-loop wins:

  • 1 Hz throttle on the wifi-status file stat_check_wifi_status_message ran a filesystem exists() at frame rate (60+/sec) for an overlay message whose lifetime is measured in seconds. Result cached within the window.
  • Journald noise: the per-iteration "Display active, processing mode" INFO is now DEBUG, and the remaining eager f-string logs in the mode path are lazy %-style. Baseline on the devpi measured ~9 journal lines/sec — that's log I/O + SD wear for nothing.
  • Vegas cycle-end blank frame: inline from PIL import Image and a fresh allocation per scroll-cycle wrap replaced with a reused, re-blacked buffer.

Explicitly deferred (per plan): scroll_helper's per-frame frombytes/tobytes allocation.

Verification

195 display/vegas/controller tests pass. Devpi journal-rate re-measurement to follow with the series deploy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FqzC1nzTWL4kaqgMaQZFam

- _check_wifi_status_message stat'd the status file on every render
  iteration (60+ fps) for a message whose lifetime is seconds; throttle
  the check to 1 Hz with a cached result.
- Demote the per-iteration "Display active, processing mode" INFO to
  DEBUG and convert the remaining eager f-string logs to lazy % args —
  the devpi baseline showed ~9 journald lines/sec, which is both noise
  and SD-card wear.
- Vegas cycle-end blank frame: hoist the inline PIL import and reuse a
  preallocated buffer instead of allocating per cycle wrap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqzC1nzTWL4kaqgMaQZFam
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ChuckBuilds, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7957ae4-fff5-4945-92d0-28775b2892c0

📥 Commits

Reviewing files that changed from the base of the PR and between 6edd80d and 512e386.

📒 Files selected for processing (2)
  • src/display_controller.py
  • src/vegas_mode/render_pipeline.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/hot-path-micro

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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