Improve calc performance - #2448
Merged
Merged
Conversation
Restore jewel socket distance calculations, preserve weapon-set paths when a normal path is available, and promote them when they are required. Also remove unused code and add tests for both pathing cases.
LocalIdentity
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the problem being solved:
This improves performance by:
Testing with a synthetic benchmark which runs the power report over and over ended up being around 20% faster (with a low sample size and lots of variance). This is less than the linked PR, because a decent bit of performance was from #2384's changes.
Similarly, a
BuildAllDependsAndPaths()microbenchmark seemed to indicate that the function went from around 21 ms to 8.5 ms (2.5x-ish). This is probably not very realistic. This change also needs a lot more verification because the poe2 tree seems a lot more complex than poe1. The test was done on a build with just 2 time-lost jewels. That means omitting the radius jewel -related changes didn't show in this test. If a build uses a different setup, the gains will be much lower.It should be possible to further optimise
BuildAllDependsAndPaths(). I also think the function could use a refactor in general. It's currently 600 lines (including whitespace, but still). Moving some logic into separate functions would help make it clearer what has side effects and what doesn't, which might also make further optimisation easierSteps taken to verify a working solution:
Link to a build that showcases this PR:
Oracle split personality: https://poe.ninja/poe2/pob/27a2d
Build with incr effect time-lost jewel in the east: https://poe.ninja/poe2/pob/27a2e
Before screenshot:
After screenshot: