Cache resolveAsset calls to improve web performance#396
Merged
Conversation
Merged
sephynox
approved these changes
Jul 9, 2026
|
ezraripps
added a commit
that referenced
this pull request
Jul 9, 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.



Caches graph asset path / metadata construction internally with resolveAssets to improve performance on web.
Web calling resolveAssets 190 times goes from 6.5s to ~50ms now with the cache addition.
Note
Medium Risk
Touches core asset-resolution and reachability logic; fast vs FX-like result paths could diverge if railInfo aggregation doesn't match the old scan behavior.
Overview
Caches graph-invariant lookup structures for
AnchorGraph.resolveAssets(andlistAssets, which delegates to it) so repeated filtered calls—e.g. one per source asset on web—no longer rebuild keys, adjacency buckets, and rail aggregation on every invocation.Adds a memoized
#getResolveIndex()that builds aResolveIndexonce (node keys, rail-inclusive join maps, asset-location buckets, and pre-aggregatedrailInfo). BFS now seeds fromcomputeStartIndices, using bucket lookup when both asset and location are set instead of scanning the full node list. Result assembly usesbuildResultMapFastfromrailInfowhenonlyAllowFXLikeis false; the FX-like path still scans nodes to exclude non–FX-like edges.Reviewed by Cursor Bugbot for commit 6bce448. Bugbot is set up for automated code reviews on this repo. Configure here.