Repository navigation
Desktop: performance audit of November 2026, baseline and work packages - #477
MopigamesYT wants to merge 24 commits into
Conversation
…tate (#473) Headless benchmarks of the hot paths (perf_bench_test.go), new ONELOOP_BENCH modes (stream, type, sidebar, split, files, theme, startup, soak) with memory, allocations per frame, launch milestones and pprof output, a synthetic state generator and a runner for the test VM. Assisted-by: Claude Opus 5.5 low
Assisted-by: Claude Opus 5.5 low
canvas.Image keeps one decoded SVG per (resource, colour) instead of colourising and parsing the XML at every Refresh; the sidebar keeps its project and chat rows between renderings and refreshes only those that changed; the ⋯ inset is a constant instead of a row built per row. BenchmarkPerfRenderChats: 19.5 ms, 5.1 MB, 73.9k allocs -> 2.5 ms, 1.05 MB, 18.1k allocs on the same machine. Assisted-by: Claude Opus 5.5 low
The XDG portal answers at launch with the variant already in use, and Fyne then re-themed every window (~180 ms on the UI thread, llvmpipe). The variant is applied only when it changes, and a variant-only change no longer re-themes the windows: 1loop sets a new theme when its own follows the system. Assisted-by: Claude Opus 5.5 low
…475) The ring (512 px, decoded, inked, resampled) is drawn once per ink and size, off the UI thread, and shared by the marks. The phone remote, the linked servers, the update check and the other windows of the last run start 100 ms after the window shows, behind the first frame. Assisted-by: Claude Opus 5.5 low
The caret blink and the frame hook kept the window repainting at 8 fps forever with the composer focused. The caret now blinks without a full window refresh and stops after inactivity; the frame hook is no longer a never-ending fyne.Animation. Patches the vendored Fyne (third_party/fyne: widget cursor animation, common canvas, driver refresh counter). Assisted-by: Claude Opus 5.5 low
Fyne cleared the measured text sizes with the icons on every theme change, and ThemeOverride reset every cache once per widget under it (thousands for the transcript). A new ResetThemeColourCaches drops the themed icons only, once per override apply. The theme folder is watched with fsnotify instead of polled (go.mod: fsnotify now direct). Assisted-by: Claude Opus 5.5 low
…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
Desktop: faster startup and a sidebar that reuses its rows (#475)
Conflict in glfw/loop.go settings listener: kept both the VariantOnly early return and the KeepFonts cache reset.
No textual conflict; fixed the ring tests that waited on a fyne.Do now queued by the #476 test driver (added test.Drain).
Desktop: memory and binary size, race-free UI tests (#476)
Desktop: long chats: transcript layout, streamed markdown, scroll bench (#473)
Desktop: nothing redraws when idle, cheaper theme changes (#474)
|
Found while testing on the linux-test VM (Plasma Wayland, 1280×800). I merged this PR alone onto dev 8089b0a and compared it with dev, on the same profile and the same screens. 1. Every outline is bright. The settings search field, the outlined buttons (New theme / Duplicate / Open folder, Later), the 2. The composer and the sidebar footer move 14 px down. On dev the composer's top edge is at y=639 and the window's last 14 px are empty. With this PR it's at y=653, and the bottom of the window holds content. The first window (1180×760) is taller than the screen's work area (746 px above Plasma's panel), so the bottom of Settings in the sidebar, the composer's edge and the last line of the Tasks view's context overview are now under the panel. The window size itself is #512 (dev too); this PR is what makes it visible. 3. It clashes with #496. This PR changes |
Part of #473
Part of #474
Part of #475
Part of #476
Summary
Phase 1 of the desktop optimisation round, measuring and planning only (no fixes). The baseline was measured on the test VM with a 200-chat state and a 4,000-row chat, on llvmpipe and on virgl, including the theme system (palette changes, shader backgrounds, and blur from #472 measured on its branch).
docs/perf/2026-11-audit.mdhas the numbers, the flame-graph findings, 16 ranked hotspots, and four independent work packages, one issue each:fyne.Doracing in testsScreenshots
No visible change.
Technical details
internal/ui/bench.go: newONELOOP_BENCHmodesidleblur,stream,type,sidebar,split,files,theme,startup,soak.ONELOOP_BENCH_SECONDSsets the span, andONELOOP_BENCH_PROFILE=<dir>writes CPU, heap and allocs profiles plus goroutines. Reports add whole-frame percentiles, allocations and KB per frame, heap/RSS/goroutines/GC at launch, before and after the span, and the launch milestones.internal/ui/desktop.go:benchMark()milestones alongrunDesktop. They do nothing unlessONELOOP_BENCHis set.internal/ui/perf_bench_test.go: headlessBenchmarkPerf*on Fyne's test driver: chat open (first/cached, 500/4,000 rows), one transcript layout, a scroll step, a streamed delta, a markdown parse,renderChatswith 200 chats,themeChanged.scripts/perf/genstate: synthetic state (chats, subchats, projects, pictures, and an optional theme fromdocs/themes).scripts/perf/run.shruns the modes on fresh copies of it and keeps reports, gctrace, the developer log and profiles.virtio-glfor the GPU runs, then set back tovirtioand shut down.go build ./...,go vet ./internal/ui ./scripts/...,go test ./internal/ui.Assisted-by: Claude Opus 5.5 low
🤖 Generated with Claude Code