Skip to content

Use vger with cached text layout - #88

Merged
wtholliday merged 1 commit into
mainfrom
vger-text-cache
Nov 26, 2026
Merged

wtholliday merged 1 commit into
mainfrom
vger-text-cache

Conversation

@wtholliday

Copy link
Copy Markdown
Contributor

What changed

vger now comes from the text-layout-cache-0.3 branch of audulus/vger-rs instead of crates.io 0.3.0. That branch is vger 0.3.0 plus the two commits of audulus/vger-rs#29:

  • text layouts are cached between frames
  • vger's caches are hashed with a fast hasher

It stays on wgpu 0.20, so nothing else in rui changes.

Why

Once #85, #86 and #87 cut update to about 1% of a hover, fontdue's text layout was the largest remaining cost. vger laid out every visible label on every frame.

Median hover on the gui-bench dashboard, over 200 moves in an offscreen harness on macOS:

Rows vger 0.3.0 This branch
300 6.48 ms 5.74 ms
1,000 11.92 ms 8.45 ms
3,000 31.09 ms 19.82 ms

Testing

  • cargo test --workspace: 135 tests and 4 doctests pass. The screenshot tests draw no text, so they don't cover this change.
  • 16 scripted frames of the dashboard with hovers, clicks, sorting and page changes are pixel-identical to those rendered with vger 0.3.0, at 30, 300 and 1,000 rows. That check used this same vger commit (9b758ad).
  • I launched text_layout, text_editor, gallery and font_size briefly and none panicked.

For reviewers

  • Publishing: a git dependency can't be published to crates.io. This should switch back to a version once vger publishes the change, for example as 0.3.1 from that branch.
  • Floating commit: Cargo.lock is gitignored, so branch = ... resolves to the branch's latest commit whenever a lockfile is created. Use rev = "9b758ad" instead if you want it fixed.

🤖 Generated with Claude Code

Points vger at the text-layout-cache-0.3 branch of audulus/vger-rs:
vger 0.3.0 plus audulus/vger-rs#29, which caches text layout between
frames and hashes vger's caches with a fast hasher. On the gui-bench
dashboard with 3,000 order rows, a hover goes from 31 ms to 20 ms.

A git dependency can't be published to crates.io, so this should go
back to a version once vger releases the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wtholliday added a commit to audulus/gui-bench that referenced this pull request Nov 26, 2026
rui's vger-text-cache branch (audulus/rui#88) is main after audulus/rui#85-#87,
which skip unchanged parts of the UI, on a vger that caches text layouts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wtholliday
wtholliday merged commit f45bdaa into main Nov 26, 2026
4 checks passed
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