Skip to content

Further optimise BuildAllDependsAndPaths() - #10312

Open
vaisest wants to merge 3 commits into
PathOfBuildingCommunity:devfrom
vaisest:more-bdap
Open

Further optimise BuildAllDependsAndPaths()#10312
vaisest wants to merge 3 commits into
PathOfBuildingCommunity:devfrom
vaisest:more-bdap

Conversation

@vaisest

@vaisest vaisest commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

This further optimises BuildAllDependsAndPaths() a tiny bit. In my totally realistic synthetic benchmark it made it about 1 ms faster (5.6 -> 4.6). This is done by sorting path neighbours so that the FindStartFromNode() does less work on average, and by changing the node path from an array of the whole path, to just linking to a parent node.

Steps taken to verify a working solution:

  • Tests pass
  • Tree behaves as expected when manually tested

Link to a build that showcases this PR:

Build used for testing: https://poe.ninja/poe1/pob/98d8f

if not hoverNode.path then
-- Mastery nodes cannot be traced through as they are allocated through
-- a popup, and cannot be pathed out of
if hoverNode and hoverNode.type ~= "Mastery" then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also fixes a crash when a mastery node is on the trace path

@vaisest vaisest added technical Hidden from release notes pob2 Label for features that should be ported over to PoB-PoE2 labels Aug 30, 2026
@vaisest vaisest changed the title Optimise FindStartFromNode() somewhat Further optimise BuildAllDependsAndPaths() Aug 30, 2026
@mcagnion

Copy link
Copy Markdown
Contributor

Reproduced on 910adabc: Shift-tracing an alternative path to a mastery is silently ignored. After selecting the mastery effect, PoB allocates the default route instead of the highlighted one.

SaveMasteryPopup() only forwards viewer.tracePath when the mastery is its final node. The new hoverNode.type ~= "Mastery" guard prevents that, so AllocNode() receives nil and follows pathParent.

Enregistrement.2026-08-30.124944.mp4

AI-assisted review disclosure: This finding was identified during a review using OpenAI Codex and confirmed with a focused manual reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pob2 Label for features that should be ported over to PoB-PoE2 technical Hidden from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants