Repository navigation
Desktop: memory and binary size, race-free UI tests (#476) - #493
Merged
Merged
Conversation
…inux (#476) Fyne's Noto Sans and DejaVu fonts are stored gzipped and unpacked on first use. On Linux the 4.2 MB EmojiOneColor font is no longer bundled: emoji use the system's colour emoji font, loaded the first time one is drawn. Windows keeps the bundled font, which its own emoji font cannot replace. Release binary: 47.2 MB to 41.9 MB. Assisted-by: Claude Opus 5.5 low
Every style and every theme reset parsed the same font files again; the audit measured 17.7 MB of duplicate parsed faces. Assisted-by: Claude Opus 5.5 low
GOGC 50: a collection when the heap grows by half rather than doubles. GOGC in the environment still wins. No memory limit: one below the live heap (a 40,000-row chat open) made the collector run back to back on the test VM and the window crawl. Assisted-by: Claude Opus 5.5 low
…utine (#476) Under Fyne's test driver, fyne.Do ran its function on the calling goroutine, so work handed to the UI from timers and goroutines ran alongside the test: 600 to 1,100 data races per race-detector run. Work from other goroutines now waits in a queue that the test goroutine runs (fyne.Do, DoAndWait, Drain, a new app). Only DoAndWait from another goroutine gets a helper that runs the queue after 20 ms, so it cannot deadlock. Assisted-by: Claude Opus 5.5 low
Each save, 400 ms after a change, encoded every chat into one buffer the size of the state file (97 MB on a real install), grown by doubling, then wrote it: a few hundred MB of garbage per save while agents stream, which drove a running 1loop past 1.4 GB of RSS. The chats are now encoded and written one at a time through a buffered file; the file is the same, byte for byte. Assisted-by: Claude Opus 5.5 low
No textual conflict; fixed the ring tests that waited on a fyne.Do now queued by the #476 test driver (added test.Drain).
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.
Closes #476. Stacked on #477 (
perf/audit): merge that first, then retarget this tomain.What changes
GOGCin the environment wins). I tried a soft memory limit too and dropped it: below the live heap (a 40,000-row chat open) it made the GC run back to back and the window crawl.state.json, so that is a few hundred MB of garbage per save. The chats are now encoded and written one at a time through a buffered file. The file is byte-for-byte the same (new testTestWriteChatsMatchesWholeEncoding).fyne.Doran on the calling goroutine, so UI work from timers and goroutines ran alongside the test. It now waits in a queue that the test goroutine runs (fyne.Do,DoAndWait,test.Drain, a new app). OnlyDoAndWaitfrom another goroutine gets a 20 ms fallback runner, so it can't deadlock.Numbers (VM 111, llvmpipe,
streambenchmark, 60 s)-trimpath -s -w)go test -race ./internal/uiThe 40,000-row state (37 MB) is noisy (the UI thread takes minutes to load such a chat, in
syncCopies/offsetIn, which this PR doesn't touch): peak RSS 2.31 → 1.93 GB, RSS at end of span 1.37–2.36 → 1.11 GB.On the VM,
TestDiscordArtandTestEverySettingIsMarkedfail only because they read repository files by relative path; they pass in the source tree.Not done
oksvgto drop the CJK encodings (~0.6 MB). Both are feature or maintenance decisions.Assisted-by: Claude Opus 5.5 low
🤖 Generated with Claude Code