Skip to content

perf(host): 缩短首次快照等待时间 - #119

Merged
Ray-lea merged 2 commits into
Ray-lea:mainfrom
hayxe1:perf/first-snapshot-startup
Nov 15, 2026
Merged

Ray-lea merged 2 commits into
Ray-lea:mainfrom
hayxe1:perf/first-snapshot-startup

Conversation

@hayxe1

@hayxe1 hayxe1 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Task-manager replacement starts keep the main window hidden until the first snapshot is accepted by the UI. After the collector finishes priming, the sampler currently waits a normal update interval; restoring startup settings can also move that first deadline. This adds avoidable waiting before the window can be shown.

Schedule the first snapshot at the existing 250 ms minimum sample gap, retain that deadline while startup controls load, and establish the selected regular cadence from the first sample. The minimum gap for rate counters, complete snapshot collection, subsequent foreground/background/paused cadence, and the task-manager readiness handshake are preserved. Includes two regression tests and the corresponding host architecture documentation.

Validation

  • cargo fmt -p argus-app --check
  • ARGUS_LOCALE=en-US cargo test --locked -p argus-app --lib sampler::tests: 8 passed, including the two new startup scenarios. The new scenarios fail with the previous schedule logic.
  • Built the base (69e8c6d6) and changed EXEs with Rust 1.100.0 MSVC and the same release profile.
  • Three runs per EXE, ordered before/after/after/before/before/after, using isolated --hidden --test --identifier profiles on inactive desktops. Time from the startup log to the first collected snapshot:
Release EXE Median Range
Base 1,455 ms 1,454–1,476 ms
Changed 715 ms 709–721 ms

The measured reduction is 740 ms (51%) in this hidden-start path. Windows 11 25H2, Ryzen 5 7500F, RTX 4060; new processes with natural/warmed filesystem caches, no cache purge or reboot.

An already displayed inactive test window requests an immediate refresh in both versions, so there was no consistent improvement there: median first nonempty process response was 811 ms vs 799 ms, with a 1,126 ms outlier in one changed run. This PR makes no general speedup claim for that path.

A short steady-state check after 25 seconds of warmup retained approximately 238 presented frames/s, a 4.17 ms p95 frame interval, zero frames longer than 50 ms, and comparable private memory (158 vs 157 MiB while shown). CPU/GPU and hidden-window counters were also collected; varying desktop load means this single pair is a regression smoke check, not a steady-state performance claim. All 12 startup runs and both steady checks exited successfully without foreground-activation violations.

The complete installed IFEO/hotkey path and the first launch after a reboot were not benchmarked. This change removes the confirmed post-priming wait; it does not claim to explain or eliminate an entire reported five-second cold launch.

首次快照使用既有的 250 ms 最短采样间隔,启动设置保留该期限,之后恢复所选采样周期。隔离隐藏启动的首次快照中位数由 1455 ms 降至 715 ms。
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T23:56:01.307551Z 08629e0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Ray-lea
Ray-lea merged commit cc60777 into Ray-lea:main Nov 15, 2026
2 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.

2 participants