Skip to content

Improve radius jewel tooltip performance - #9863

Open
mcagnion wants to merge 8 commits into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/radius-jewel-tooltip-performance
Open

Improve radius jewel tooltip performance#9863
mcagnion wants to merge 8 commits into
PathOfBuildingCommunity:devfrom
mcagnion:bugfix/radius-jewel-tooltip-performance

Conversation

@mcagnion

@mcagnion mcagnion commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

Radius jewel stat comparison fixes from PR 9746 made Compare tab hovers expensive, especially when moving quickly between jewels. Full multi-slot tooltips could rebuild temporary passive specs and recalculate comparison outputs for every compatible jewel socket.

This PR keeps the existing tooltip behavior while reducing repeated work:

  • Compare tab passes the hovered slot into item tooltips and avoids rebuilding unchanged hover tooltips.
  • Affected-slot and full multi-slot comparisons share one output cache until outputRevision changes.
  • Temporary comparison specs rebuild calculator state and socket distances without rebuilding regular or Split Personality highlight paths used only by the passive-tree UI.
  • Limited-unique comparisons skip socket outputs that will not be displayed.

Measured locally, the output cache does not improve first-pass hovers over never-seen jewels, but it strongly improves repeated and bouncing hovers:

  • Full multi-slot two-pass hover: 247.69 -> 69.62 ms/frame, 128 -> 64 rebuilds and calculator calls.
  • Full multi-slot bounce between two jewels: 202.19 -> 18.56 ms/frame, 128 -> 16 rebuilds and calculator calls.
  • With affected-slot tooltips enabled, two passes now require 8 rather than 16 calculator calls; bouncing between two jewels requires 2 rather than 16. First-pass structural counts are unchanged.

Cached outputs are scoped to one outputRevision epoch and discarded after build output changes. Temporary unstored items remain uncached.

Steps taken to verify a working solution:

  • Added focused coverage for cache invalidation, cold/warm tooltip equivalence, limited uniques, and calculation-only versus full passive-spec rebuilds.
  • Ran the radius jewel tooltip performance matrix before and after the cache unification.
  • Manually tested Compare tab revisits and jewel alternation with "Show tooltips only for affected slots" ON and OFF.

Link to a build that showcases this PR:

N/A. The change is performance-focused and was verified with local Compare tab testing plus the benchmark matrix.

Before screenshot:

N/A. No visual UI change.

After screenshot:

N/A. No visual UI change.

@mcagnion
mcagnion force-pushed the bugfix/radius-jewel-tooltip-performance branch 2 times, most recently from 7ebd706 to b5f7a20 Compare August 6, 2026 09:14
@mcagnion
mcagnion marked this pull request as ready for review August 6, 2026 14:38
@mcagnion
mcagnion force-pushed the bugfix/radius-jewel-tooltip-performance branch from b5f7a20 to c52198c Compare August 17, 2026 17:39
Avoid rebuilding radius-jewel comparison specs for repeated targeted tooltip hovers and skip limited-unique socket outputs that will not be shown. Preserve full multi-slot tooltip behavior when slot-only tooltips are disabled. Related local follow-up to PR 9746.
Tooltip comparison specs only need calc state, but radius jewel comparisons
were still rebuilding passive tree UI paths for every temporary spec.
Skip that path rebuild while preserving socket distance recomputation for
Split Personality-style jewel scaling.
Reuse full radius jewel comparison outputs while the build output
revision is unchanged. This reduces repeated Compare-tab hover work for
slotOnlyTooltips=OFF without caching cloned specs or changing comparison
behavior.
Keep the rebased regression tests compatible with the current class constructor API.
Include Shift in the tooltip update key and clear cached update parameters before drawing the Equip comparison tooltip.
@mcagnion
mcagnion force-pushed the bugfix/radius-jewel-tooltip-performance branch from c52198c to a50712a Compare August 21, 2026 21:22
Compare the first-pass tooltip text with the warm-cache result so the output-cache test covers semantic equivalence as well as reduced calculator calls.
Use the established slot-only vocabulary and document the cache-key sentinels and selective passive-path rebuild contract found during cumulative naming review.
Use the existing output cache for slot-only and multi-slot hovers instead of retaining temporary passive specs. Keep calculation-only specs free of UI path data while preserving socket distances. This reduces duplicate state and repeated calculations without changing tooltip content.
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