Skip to content

Improve calc performance - #2448

Merged
LocalIdentity merged 4 commits into
PathOfBuildingCommunity:devfrom
vaisest:calc-perf
Aug 28, 2026
Merged

Improve calc performance#2448
LocalIdentity merged 4 commits into
PathOfBuildingCommunity:devfrom
vaisest:calc-perf

Conversation

@vaisest

@vaisest vaisest commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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 easier

Steps taken to verify a working solution:

  • Split personality works
  • Time-lost jewel effect works
  • Entwined realities works
  • From nothing works
  • Tests pass

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:

vaisest and others added 4 commits August 28, 2026 20:34
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 LocalIdentity added the enhancement New feature, calculation, or mod label Aug 28, 2026
@LocalIdentity LocalIdentity changed the title Port "Improve calc performance" (#10228) Improve calc performance Aug 28, 2026
@LocalIdentity
LocalIdentity merged commit 9394553 into PathOfBuildingCommunity:dev Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, calculation, or mod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants