Files
benilla-octo/crates
gromandClaude Opus 5 cd6731799b ui: memoise the texture-existence probe, as its two neighbours already are
`set_texture_probe`'s closure answers every path form of `SetTexture`, and it
was the only one of the three probes installed beside it without a cache —
`set_texture_size_probe` and `set_font_probe` both memoise, and the font one's
comment already gives the reason that applies here verbatim: a path's answer
cannot change, and an addon may ask every frame.

A miss is the expensive answer. An addon texture is never in the MPQ chain, so
both candidates fall through to `loose_addon_file`, which walks the path one
component at a time and, whenever a component's real spelling is not the
lower-cased one it was handed, enumerates that whole directory to compare
case-insensitively. `Interface\AddOns` holds 94 folders here and `pfquest` never
matches `pfQuest` on a case-sensitive filesystem, so an uncached call read that
directory twice over, on the main thread, between two systems.

grom's 2026-10-21 17:08 session priced it: `[ui-verbs]` reports
`texture:SetTexture` at **45-59 us a call across all 33 windows** — stable
enough to be a fixed charge rather than a tail — against the ~0.2 us a cached
existence answer costs. 1.75 ms a frame over 34 calls while the world map was
up, because `WorldMapFrame_Update` re-textures every overlay tile and POI on
each `WORLD_MAP_UPDATE`. Replaying the same walk over the real AddOns tree
reproduces 26-42 us for a single candidate.

Misses are cached too, as the size probe's are: an addon probing for optional
art is the common case and it is the one that pays for the walk.

This is the smaller half of the map's cost — `scrollframe.rs`' derivations were
the larger — and it is a ~1-2% of frame fix, not the dip.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 17:47:07 -06:00
..