Skip to content

Speed up Full DPS comparisons by caching trigger source calculations (Kitava’s Thirst) - #10386

Open
AdamZ-8113 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
AdamZ-8113:perf/full-dps-trigger-source-cache
Open

AdamZ-8113 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
AdamZ-8113:perf/full-dps-trigger-source-cache

Conversation

@AdamZ-8113

Copy link
Copy Markdown
Contributor

Related to #5713 -- I haven't noticed UI lag anymore but the calcs run so slow it feels like they won't complete.

Description of the problem being solved:

When Kitava's Thirst is equipped, especially with multiple skills socketed into it, "Full DPS" calcs take several minutes to complete. This PR speeds things up 3-4x.

This happens because with Kitava's Thirst, finding the trigger source means fully calculating every other skill in the build to see which one pays enough mana or life per use. In a Full DPS Power Report, this search runs once for the main pass and again for each Full DPS pass. Skills that could never pay the cost still get a full calculation before being thrown out.

This PR:

  • Shares trigger-source calculations between the main pass and the Full DPS passes of a single comparison. This applies to any trigger that searches for a source, not just Kitava's Thirst.
  • Adds a minimumCostPerUse trigger setting, replacing Kitava's two custom comparers. Candidates that can't pay the cost stop right after the cost is calculated.

Calculation results are unchanged.

Steps taken to verify a working solution:

  • Compared against dev on a Foulborn Kitava Crackling Lance build: the main output, node and item comparisons, every Power Report value and the Full DPS unique sort order are identical.
  • A Power Report for Full DPS (Depth "All") goes from ~413s to ~120s. Depth "5" goes from ~181s to ~45s.
  • Sorting uniques by Full DPS is also much faster. No change on a non-Kitava build.
  • Added tests for Kitava/Foulborn Kitava Full DPS and for Reflection not reusing a stale rejected source. Full suite passes.

Link to a build that showcases this PR:

https://pob.codes/b/24AmziqciCB

… early in calculator comparisons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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