perf: light background mode, idle input cadence and performance measurement - #240
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes ControlFS light enough to sit next to a game, measured before and after.
build/Measure-Performance.ps1, new step in the manual Smoke workflow, full mode only; no new workflows or triggers): launches the portable exe (first run with an empty extraction dir + 3 warm runs) and the installed exe, and records ms to "Janela ativada" / "Primeiro quadro" (new precise log lines), CPU %, working set, private bytes and threads over 10 s idle in the foreground and 10 s minimized (ShowWindow(SW_MINIMIZE)), plus package sizes. Table goes to the job summary and theperformanceartifact; a run whose app exits mid-measurement fails the step.main(fail-fast E_INVALIDARG from a WinUIAppWindow.Changedhandler reading the minimized title bar; dump analysis in the smoke log). Fixed: title-bar updates skip the minimized state and never let an exception escape that event; minimizing no longer relayouts.InputCadence): the 8 ms ticker + 1 ms Windows timer now run only with the window in front and a controller connected; with no controller the UI timer polls at 250 ms just to notice one arriving (keyboard/mouse come through XAML events).BackgroundModePolicy, new setting Leve em segundo plano, on by default): when the window is inactive or minimized (a minimized sole window stays "active", so the presenter state counts too): BelowNormal priority + EcoQoS, controllers only watched for connections every 1 s with SDL input events disabled (a game using the same pad no longer floods our queue; stick/trigger state is resynced silently on return), drive polling paused (checked immediately on return), and after 5 s a single aggressive GC + LOH compaction + working-set trim. Activation restores at once; media playing keeps normal priority.Before / after (GitHub windows-latest, WARP, no controller; median of 3 Smoke runs, each the median of 3 warm launches; installed in parentheses)
Pure
maincould not be measured minimized (it crashed). Runner-to-runner noise is large (the same build measured 543–1100 ms to window), so the startup difference is within noise. Details and methodology indocs/performance.md.Tests
InputCadenceTests(2),BackgroundModePolicyTests(2),UpdateFlowTests::Automatic_check_waits_for_the_first_frame_when_deferred.--render-screens(UIElementCollection.AddE_ABORT at the very end), a flake also seen on the measurement-only commit (36375709199) and not touching code changed here.docs/TESTING.md("Leve em segundo plano e repouso").Docs: CHANGELOG pair (Desempenho/Performance + fix), GUIDE pair (new setting),
docs/ui-redesign.mdrow,docs/performance.mdrewritten.🤖 Generated with Claude Code