[PR #1471] [MERGED] Text: the glyph cache hashes chars with Fx instead of SipHash #3548

Closed
opened 2026-11-03 04:10:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1471
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: perf/glyph-cache-fxhash


📝 Commits (2)

  • 4fa5966 Text: the glyph cache hashes chars with Fx instead of SipHash
  • 4a442f7 Merge remote-tracking branch 'origin/main' into perf/glyph-cache-fxhash

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/font.rs (+3 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Part of #1461 ("large amounts of signs with text cause lag").

Measurements

Same view on the Mac mini (Metal, 1280x720, uncapped, inactivityFpsLimit minimized), with the same saved world in both clients:

100 text signs in view no signs
Horizon main ~2125 fps (0.47 ms) ~3690 fps
vanilla 26.3 (fps counter agent, same world) ~84 fps ~110 fps

Signs cost Horizon less than vanilla, both in absolute time and relative to the frame. The report's screenshots come from different views (Linux, Vulkan, RTX 4060), so they don't measure the signs.

Change

A sampling profile of the 100-sign view put Font::glyph_of and SipHash at the top. The glyph cache now hashes its char keys with FxHashMap.

Benchmark (A/B/A)

With 100 text signs, the frame's prepare time goes from 0.32 ms to 0.22 ms, and fps from about 1920 to about 2250. The before runs were taken both before and after the patched run.

Self-check

These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini):

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too.
  • cargo test -p horizon-client --lib: 1063 passed. --bins: 98 + 18 passed.
  • tools/parity.py --changed origin/main: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, menu_click, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), menu_click passes: 8000/8000 with seed 7 and with seed 11.

Needs Ludovic

Nothing.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1471 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/glyph-cache-fxhash` --- ### 📝 Commits (2) - [`4fa5966`](https://github.com/horizon-rust/horizon/commit/4fa59663384b1a4b61df770f471164aa32aa36ad) Text: the glyph cache hashes chars with Fx instead of SipHash - [`4a442f7`](https://github.com/horizon-rust/horizon/commit/4a442f7250fe5911875ba5bd0d91f632f90f945a) Merge remote-tracking branch 'origin/main' into perf/glyph-cache-fxhash ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/font.rs` (+3 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of #1461 ("large amounts of signs with text cause lag"). ## Measurements Same view on the Mac mini (Metal, 1280x720, uncapped, `inactivityFpsLimit` minimized), with the same saved world in both clients: | | 100 text signs in view | no signs | |---|---|---| | Horizon main | ~2125 fps (0.47 ms) | ~3690 fps | | vanilla 26.3 (fps counter agent, same world) | ~84 fps | ~110 fps | Signs cost Horizon less than vanilla, both in absolute time and relative to the frame. The report's screenshots come from different views (Linux, Vulkan, RTX 4060), so they don't measure the signs. ## Change A sampling profile of the 100-sign view put `Font::glyph_of` and SipHash at the top. The glyph cache now hashes its `char` keys with `FxHashMap`. ## Benchmark (A/B/A) With 100 text signs, the frame's prepare time goes from 0.32 ms to 0.22 ms, and fps from about 1920 to about 2250. The before runs were taken both before and after the patched run. ## Self-check These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini): - `cargo fmt --all -- --check`: clean - `cargo clippy --workspace --all-targets -- -D warnings`: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too. - `cargo test -p horizon-client --lib`: 1063 passed. `--bins`: 98 + 18 passed. - `tools/parity.py --changed origin/main`: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, `menu_click`, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), `menu_click` passes: 8000/8000 with seed 7 and with seed 11. ## Needs Ludovic Nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3548
No description provided.