|
Repo Added
|
Files
21
|
Badge
README BADGES
|
push
github
perf: optimize viewport to skip redundant refreshes (#300) * perf: optimize viewport to skip redundant refreshes Introduces a `_dirty` flag and an optional `force` parameter to the `viewport.refresh` method. This ensures that the underlying device's `display` method is only invoked when content has actually changed, reducing unnecessary I/O and CPU usage. Changes include: - Tracking a `_dirty` state when hotspots are removed. - Adding a `force` flag to `refresh()` to allow explicit overrides. - Updating `display()` and `set_position()` to trigger a forced refresh. - Skipping the `device.display()` call if no redraw is required and no state changes are detected. ```mermaid sequenceDiagram participant App participant Viewport participant Hotspot participant Device App->>Viewport: refresh(force) Viewport->>Hotspot: should_redraw() Hotspot-->>Viewport: redraw_needed alt force or redraw_needed or dirty Viewport->>Device: display(image) Note over Viewport: Set dirty = False else no changes Note over Viewport: Skip display update end ``` Fixes #280 * fscking whitespace * chore: enable colored output in CI logs Set environment variables to force colored output for tools and disable the interactive `tox` spinner. This improves the readability and cleanliness of the GitHub Actions logs. * Revert "chore: enable colored output in CI logs" This reverts commit f2d5e4c2d.
11 of 11 new or added lines in 1 file covered. (100.0%)
1683 of 1697 relevant lines covered (99.18%)
5.95 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|