Skip to content

Conversation

gmbronco
Copy link
Collaborator

@gmbronco gmbronco commented Sep 2, 2025

Why this is faster

  • No recursion or repeated array copies in token-path search; we push/pop on a single shared path and visited set.
  • Incremental constraint tracking avoids O(len(path)) scans on each step.
  • Early stop based on approxPathsToReturn (as your comments suggest) keeps the search bounded.
  • Beam search on ranks uses cached per-edge limits to prune aggressively before running the expensive full-path limit calculation.
  • At most approxPathsToReturn full getLimitAmountSwapForPath evaluations per token path, instead of exploring all rank combinations.

Copy link

changeset-bot bot commented Sep 2, 2025

⚠️ No Changeset found

Latest commit: ddf6e92

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Why this is faster

- No recursion or repeated array copies in token-path search; we push/pop on a single shared path and visited set.
- Incremental constraint tracking avoids O(len(path)) scans on each step.
- Early stop based on approxPathsToReturn (as your comments suggest) keeps the search bounded.
- Beam search on ranks uses cached per-edge limits to prune aggressively before running the expensive full-path limit calculation.
- At most approxPathsToReturn full getLimitAmountSwapForPath evaluations per token path, instead of exploring all rank combinations.
@gmbronco gmbronco marked this pull request as draft September 4, 2025 08:41
@gmbronco gmbronco closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants