perf(updater): the update chip pulses forever and keeps an idle app at ~30% of a CPU core
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 79/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 領域
- desktop, performance
研究方向
Start with lib/features/updater/update_available_badge.dart and inspect how _pulse.repeat(reverse: true) is controlled, then review the existing badge tests for isPulseAnimating and pulseDuration. Implement a finite initial pulse that leaves the badge in its active colors, and update those tests. The acceptance criteria also call for a cpu_idle_update_badge scenario in benchmark/app_perf_bench.dart; done means the chip still draws attention when it appears and CPU use drops to about 0% once the app is idle.
由索引模型根據 Issue 內容生成。
描述
Problem
While the "vX.Y.Z available" chip is shown (UpdateAvailableBadge, title bar), the app animates it forever with _pulse.repeat(reverse: true) (lib/features/updater/update_available_badge.dart). The animation never stops, so the engine produces a frame at the display rate for as long as the window is open, and an otherwise idle app burns about a third of a CPU core.
This is every user who has a newer release available and has not pressed "Remind me later" (the chip stays until the update is installed or dismissed).
Measurements
Profile build of current dev (0.4.22+5), Linux, 120 Hz display, window 2056x2616. CPU time of all threads of the process from /proc/<pid>/task/*/stat, SQL workspace open, nothing happening:
| State | CPU, % of one core | Frames in 8 s |
|---|---|---|
| no update pending | 0.0-0.1% | 0 |
| update pending, chip pulsing | 29-31% | 475-480 (~59 fps) |
Thread split with the chip: main thread ~1.8-2.0 s of CPU per 8 s (~3.8-4.2 ms per frame), raster ~0.32-0.35 s, GL / compositor threads ~0.1 s.
The same effect showed up when I first measured the real app on 0.4.18, where an update to 0.4.19 existed: 30-38% of a core on the welcome screen with nothing happening, 0.0% after updating.
Wrapping the chip in a RepaintBoundary (tried, reverted) did not help: 29.4% vs 31.4%. The cost is the per-frame pipeline of the whole app (~4 ms main thread per frame), not repainting the chip, so the fix is to produce fewer frames, not to shrink the repaint.
Solution (any of these, ordered by effect)
- Finite pulse. Pulse a few cycles when the chip appears (e.g. 3 x 1.4 s) and then settle to the static "active" colors. After that the app is idle again (0%).
- Pause when the window is not visible. No pulse in the background / minimized (
AppLifecycleState != resumed, orWidgetsBindingObserver), restart on focus. - Optionally re-pulse once per day or on hover, instead of continuously.
Reduced motion already stops it (QueryaMotionLevel.off / disableAnimations); the default Full level should not be a permanent animation either.
Acceptance
- With an update pending and the window idle, CPU drops to ~0% after the initial pulse (measure with the same
/procsampling; add acpu_idle_update_badgescenario tobenchmark/app_perf_bench.dart). - Existing badge tests (
isPulseAnimating,pulseDuration) updated for the finite pulse. - Chip still catches the eye when it first appears.
Related: #987 (120 Hz epic).
- 主要語言
- Dart
- 星號
- 23
- 分支
- 1
- 平均合併
- 31 分鐘
- 30 天內合併 PR
- 570
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
QueryaHub/Querya-Desktop 的其他 Issue
-
enhancement ui
難度 2/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1689 ·
維護者通常 1 天內回覆
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflow未關閉bug frontend
難度 2/5 1-3 小時 新手友好度 82/100
QueryaHub/Querya-Desktop#1642 ·
維護者通常 1 天內回覆
-
bug error-handling settings
難度 1/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1637 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
QueryaHub/Querya-Desktop#1636 ·
維護者通常 1 天內回覆
-
enhancement marketplace
難度 2/5 1-3 小時 新手友好度 78/100
QueryaHub/Querya-Desktop#1635 ·
維護者通常 1 天內回覆
查看 QueryaHub/Querya-Desktop 的全部 Issue
相似的 Issue
-
Standalone dash flashes as its own RSVP step (e.g. Russian dialogue)可能已有人在做 @bezig01 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
daniel-pimenta-cc/ledor#53 ·
-
enhancement firebase
難度 2/5 1-3 小時 新手友好度 65/100
brysonddelozier/scribbles#24 ·
-
bug good first issue P2-Medium
難度 2/5 1-3 小時 新手友好度 64/100
basictech01/uniun#305 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
daohoangson/flutter_widget_from_html#1657 ·
維護者通常 3 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
RevenueCat/purchases-flutter#1973 ·
維護者通常 1 天內回覆