Skip to content

Desktop: faster startup and a sidebar that reuses its rows (#475) - #485

Merged
MopigamesYT merged 3 commits into
perf/auditfrom
perf/475-startup-sidebar
Nov 17, 2026
Merged

MopigamesYT merged 3 commits into
perf/auditfrom
perf/475-startup-sidebar

Conversation

@MopigamesYT

Copy link
Copy Markdown
Member

Part of #475. Stacked on perf/audit (#477, unmerged): retarget to dev once it is merged.

What changed

  • Icons: canvas.Image keeps one decoded SVG per (resource, colour) instead of re-parsing the XML at every Refresh (third_party/fyne/canvas/image_svgcache.go).
  • Sidebar: project and chat rows are kept between renderings; only changed rows are refreshed.
  • Brand ring: drawn once per ink and size, off the UI thread, shared by every mark.
  • Startup: remote, linked servers, update check and restoreWindows start after the first frame.
  • Fyne (vendored): the XDG portal's first answer no longer re-themes every window when the variant didn't change (~180 ms at launch). Touches third_party/fyne/app, internal/app, internal/driver/glfw — outside the package's file list, kept minimal.

Measurements

VM 111, llvmpipe (virtio, no GL; the audit's numbers were on virgl), 200-chat state, scripts/perf/run.sh startup, 4 warm runs each, ms since package init:

Milestone before (perf/audit) after
first frame drawn 794–878 (1217 first run) 751–790
interactive 1056–1120 (1431 first run) 791–840
first frame, empty state 743–848 662–664
interactive, empty state 778–905 662–664

BenchmarkPerfRenderChats (headless, local): 19.5 ms, 5.1 MB, 73.9k allocs → 2.5 ms, 1.05 MB, 18.1k allocs.

Against the targets

Target Status
Interactive ≤ 700 ms not met: ~800 ms (−25 %)
First frame ≤ 500 ms not met: ~775 ms. ~430 ms is spent in window.Show (GLFW/compositor) and ~120 ms in the tray's D-Bus registration, both before the first frame
ui.build empty ≤ 40 ms not met: ~150 ms, lazy settings/panels not done
RenderChats ≤ 2 ms / 1 MB almost: 2.5 ms / 1.05 MB
Sidebar scroll CPU ≤ 35 % (virgl) not measured on virgl; llvmpipe unchanged (~140 %)
State save ≤ 10 ms on UI thread not done

Left for a follow-up: lazily built settings/panels, state save off the UI thread, sidebar scroll layout cost, virgl run.

Assisted-by: Claude Opus 5.5 low

🤖 Generated with Claude Code

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
@MopigamesYT
MopigamesYT merged commit 5c4e363 into perf/audit Nov 17, 2026
@MopigamesYT
MopigamesYT deleted the perf/475-startup-sidebar branch November 17, 2026 10:08
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.

1 participant