fix(settings): defer activity log loading and bound reader buffers - #109
Merged
Merged
Conversation
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.
Why
Opening Settings synchronously scanned the accumulated diagnostic log even though Settings does not display it. The reader also held several full-file byte buffers before keeping only 1,024 events. A synthetic 64 MiB log consumed about 204 MB peak process RSS in an isolated reader harness.
What Changes
Measured: the same 64 MiB synthetic fixture used about 2.4 MB peak RSS after the change. Reader refresh took 254 ms before and 222 ms afterward. This is an optimized standalone harness using the production reader, not installed-app latency evidence.
Scope
This fixes eager Settings I/O and whole-file buffering. First-time Commands/Activity loading still scans the log snapshot; background parsing and disk rotation are separate follow-ups.
Verification
490 Rust tests and all 12 keyboard-layout child scenarios passed; 12 opt-in native tests were skipped. Strict Clippy, formatting, and whitespace checks passed. New tests cover lazy pane loading, streamed retention/context, oversized records, split Unicode, truncation, and replacement. Native Settings interaction and Linux runtime checks were not run locally.