[PR #2010] [MERGED] Mob models: one skip lookup per part, not one per polygon #3935

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2010
Author: @Domanffe
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: perf/skip-lookup-once


📝 Commits (3)

  • 5191108 Mob models: one skip lookup per part, not one per polygon
  • 77def1f Mob models: a skipped part still draws its children
  • 11eb74b Merge remote-tracking branch 'origin/main' into perf/skip-lookup-once

📊 Changes

1 file changed (+19 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/mobs/render.rs (+19 -15)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

mobs/render.rs: draw asked poses.skips(part) once per polygon of a part — a HashSet<String> lookup for every polygon, of every part, of every mob, every frame — although the answer is the same for all of them. It is asked once now, before the loop.

No behaviour change: the filter never depended on the polygon, so skipping the part is the same as drawing none of its polygons. The skip test stays where the transform was already computed, so a skipped part still costs exactly what it did.

No number, and I am not going to invent one: tools/graphics_bench.py cannot run on this machine at all (it drives vscreen, a Linux virtual screen, and dies with FileNotFoundError: vscreen), and the client's own --benchmark village runs at cpu_p50 0.326 ms, which is far coarser than a hash lookup. So this is a redundant lookup removed, not a claimed speedup — worth taking only because it is two lines and obviously identical in behaviour.

cargo fmt --all --check and cargo clippy -p horizon-client --all-targets -- -D warnings pass.


🔄 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/2010 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/skip-lookup-once` --- ### 📝 Commits (3) - [`5191108`](https://github.com/horizon-rust/horizon/commit/51911080f0ef023f347f6133e3a2dc8531c486a4) Mob models: one skip lookup per part, not one per polygon - [`77def1f`](https://github.com/horizon-rust/horizon/commit/77def1f2dd13fe5c7d3f96d6c745c74312409501) Mob models: a skipped part still draws its children - [`11eb74b`](https://github.com/horizon-rust/horizon/commit/11eb74b0b60fae1324c982b328f1d6a27e17c1fa) Merge remote-tracking branch 'origin/main' into perf/skip-lookup-once ### 📊 Changes **1 file changed** (+19 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/render.rs` (+19 -15) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. `mobs/render.rs`: `draw` asked `poses.skips(part)` once per polygon of a part — a `HashSet<String>` lookup for every polygon, of every part, of every mob, every frame — although the answer is the same for all of them. It is asked once now, before the loop. No behaviour change: the filter never depended on the polygon, so skipping the part is the same as drawing none of its polygons. The skip test stays where the transform was already computed, so a skipped part still costs exactly what it did. No number, and I am not going to invent one: `tools/graphics_bench.py` cannot run on this machine at all (it drives `vscreen`, a Linux virtual screen, and dies with `FileNotFoundError: vscreen`), and the client's own `--benchmark village` runs at `cpu_p50 0.326 ms`, which is far coarser than a hash lookup. So this is a redundant lookup removed, not a claimed speedup — worth taking only because it is two lines and obviously identical in behaviour. `cargo fmt --all --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:23 +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#3935
No description provided.