Skip to content

perf(gui): open the first window faster - #381

Closed
chrispository wants to merge 1 commit into
thisisgm:mainfrom
chrispository:perf/parallel-pipelines
Closed

chrispository wants to merge 1 commit into
thisisgm:mainfrom
chrispository:perf/parallel-pipelines

Conversation

@chrispository

@chrispository chrispository commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This will need to wait until after this is merged, then repoint this to the main flea repo.

thisisgm/gpui-omarchy#7

Summary

Opens the first window faster, mostly on NVIDIA: 33% faster on an everyday launch and 43% faster on first launch or after a driver update. This replaces #378 and #379.

One commit with two parts:

Numbers

Setup:

  • Machine: RTX 4090 (driver 615.78.08), Ryzen 7 5800X3D, Hyprland 0.56.2.
  • Folder: the 100k-file bench fixture.
  • Every launch: page cache dropped, fresh XDG_STATE_HOME.
  • Order: builds interleaved in rotated order.
  • Medians, with min–max in brackets.
  • Builds: the same release profile, no instrumentation.

The middle column is the alpha-mode and prewarm half of the change (the old #378 and #379), shown so each half's share is visible.

Shader cache warm: the everyday launch (6 launches per build)

main Alpha mode + prewarm This PR Change
Window mapped 452 ms [444–499] 354 ms [319–367] 305 ms [297–354] −33%
Settled 953 ms [944–1002] 846 ms [809–864] 805 ms [731–900] −16%
CPU time 0.38 s 0.38 s 0.37 s −1%
GUI + backend PSS 85.9 MiB 86.0 MiB 86.3 MiB +0.5%

Shader cache cold: first launch, or after a driver update (5–6 launches per build)

main Alpha mode + prewarm This PR Change
Window mapped 699 ms [634–721] 553 ms [504–565] 397 ms [383–432] −43%
Settled 1199 ms [893–1218] 1046 ms [1002–1054] 887 ms [690–920] −26%
CPU time 0.63 s 0.56 s 0.56 s −10%
GUI + backend PSS 114.8 MiB 114.4 MiB 117.9 MiB +2.7%

The per-change measurements, the memory trade-off of the thread count, and the remaining NVIDIA driver cost (~100 ms of driver init and device creation, plus ~17 MiB of driver memory per process) are in thisisgm/gpui-omarchy#7.

Where to call prewarm_gpu(): the chosen spot is right after backend log setup, before Service::launch. Calling it on the first line of main was no faster (176.2 vs 176.9 ms, page cache warm). Calling it after the settings worker spawns lost most of the gain (186.1 ms).

Visual check

Screenshots against main in all three Omarchy window modes (opaque, transparent, glassy). Each window was opened in every mode, then switched through the others while it stayed open. Nothing differed except a hover highlight and a folder size that was still being counted.

Diff

  • Cargo.toml: 2 lines.
  • Cargo.lock: only the GPUI package sources change.
  • crates/flea-gui/src/main.rs: +3.

cargo metadata --locked resolves. The benchmarked build used the same Flea and GPUI code, with GPUI built from a local checkout.

Not measured: Intel and AMD.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The workspace GPUI dependencies now use a different repository revision. The GUI main function prewarms the GPU before starting locale and settings work.

Changes: GPUI startup

Layer / File(s) Summary
Update GPUI dependency pin
Cargo.toml
Both workspace dependencies now point to chrispository/gpui-omarchy at revision 4e83a9be51c76ee7dbb8db1a16bc58e63026091c.
Prewarm GPU during startup
crates/flea-gui/src/main.rs
main calls gpui_platform::prewarm_gpu() before locale and settings startup work.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • thisisgm/flea#376 — This change prewarms the GPU in the same startup path, but does not add the NVIDIA ICD filtering or opt-out described in the issue.

Possibly related PRs

  • thisisgm/flea#379 — Changes the same GPUI dependency pins and adds the same startup prewarming call; this PR continues the pin update.
  • thisisgm/flea#378 — Updates the same GPUI dependency pins, and this PR’s revision continues that pin chain.

Suggested reviewers: thisisgm

Merge Risk: Minimal · up to f1696

No merge-blocking issue is established for the dependency update and GPU prewarming change. Merge after normal build and startup checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title "perf(gui): open the first window faster" matches the main goal of the PR, which is to reduce time-to-first-window. The changeset pins GPUI to a revision with alpha-mode, Vulkan prewarm, and…
Description check Passed The description covers the core content of the change. It states what changes and why, gives the goal of faster window opening, and includes benchmark proof with before and after numbers, which fits t…
Full details: Title check

Explanation

The title "perf(gui): open the first window faster" matches the main goal of the PR, which is to reduce time-to-first-window. The changeset pins GPUI to a revision with alpha-mode, Vulkan prewarm, and parallel pipeline work, and adds a prewarm_gpu() call in flea-gui main.rs. The title names the performance goal but not the mechanism (a GPUI pin bump plus a prewarm call), so it is a clear but broad summary.

Full details: Description check

Explanation

The description covers the core content of the change. It states what changes and why, gives the goal of faster window opening, and includes benchmark proof with before and after numbers, which fits the Proof section. It explains where prewarm_gpu() is called and the GPUI pin details. Several template items are missing or incomplete: the 'What and why' section has no issue link (for example 'Fixes #123'), since it references #378 and #379 instead. The Proof section gives timings but no screenshot or recording, though the visual check covers the UI. The Checks list is absent: the author does not say whether the branch is rebased on main, whether ./tests/run-all.sh passes, or whether the change was tested by hand on Omarchy in every view. The description also contains a note that the PR must wait for an upstream merge before repointing the pin, which is useful context.

Resolution

Consider adding: (1) a linked issue or an explicit statement that none exists, (2) the Checks items with their current state, specifically whether the branch is rebased on main, whether ./tests/run-all.sh passes, and whether the hand test on Omarchy covered every affected view, and (3) a note on whether a screenshot or recording applies, since the visual check is described in text only.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d36df55-4e42-43fa-86b2-31e1f691de90
Commits

Reviewing files that changed from the base of the PR and between 73f3c23 and f169662.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2
  • Cargo.toml
  • crates/flea-gui/src/main.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Pin GPUI to chrispository/gpui-omarchy perf/window-open-stack-par (4e83a9b):
thisisgm/gpui-omarchy#7 on top of the current pin (04965e8). That stack starts
the Wayland renderer in the window's final alpha mode (pipelines built once
instead of three times), lets apps create the Vulkan instance ahead of the
first window, and builds the render pipelines on up to four threads.

Call gpui_platform::prewarm_gpu() before the locale and settings work, so the
Vulkan driver loads on a background thread while startup work runs.

RTX 4090, 100k-file folder, page cache dropped before every launch, medians of
5-6 interleaved launches against main:
  shader cache warm:  window mapped 452 -> 305 ms (-33%), settled 953 -> 805 ms (-16%)
  shader cache cold:  window mapped 699 -> 397 ms (-43%), settled 1199 -> 887 ms (-26%)
  PSS +0.5% warm, +2.7% cold; CPU time -1% warm, -10% cold

Repoint the pin to thisisgm/gpui-omarchy once thisisgm#7 merges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chrispository
chrispository force-pushed the perf/parallel-pipelines branch from f169662 to 6d6418b Compare November 4, 2026 04:56
@chrispository chrispository changed the title build(gpui): build the render pipelines in parallel perf(gui): open the first window faster Nov 4, 2026
@thisisgm

thisisgm commented Nov 8, 2026

Copy link
Copy Markdown
Owner

The first window opened slower than it needed to; your change landed as a co-authored commit in 3048f43, shipped in v0.4.1. Thanks @chrispository! https://github.com/thisisgm/flea/releases/tag/v0.4.1

@thisisgm thisisgm closed this Nov 8, 2026
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.

2 participants