Repository navigation
perf(erd): route search state in flat generation-stamped arrays (#1168) - #1238
Merged
Merged
Conversation
The grid search kept cost, predecessor, start and closed state in hash maps and sets, one entry per expanded state, boxed on every access. The state now lives in typed arrays sized once per grid, with a generation stamp per search, so nothing is cleared between the relations of a route. The search order and the result are unchanged; a 100-table schema test checks every relation routes.
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.
Refs #1168
What was done already
PR #1187 rasterized the obstacles and coalesced drag moves into one route per frame. This PR is the next item of the issue.
Changes
HashMaps andSets, boxed on every access. The state now lives in typed arrays (Float64List,Int32List) sized once per grid, one entry per (cell, direction).route()call.Not in this PR
benchmark/and in the benchmark workflow (the issue's acceptance timing). A timing assertion would be flaky on shared CI runners, so it needs a design (a report, not a gate).route()call, so one drag move allocates them again. A later change can keep them on the grid between frames.Not verified locally
Tests were not run locally, per the project rule.