Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf!(findRoute): return first result #122

Merged
merged 3 commits into from
Jul 24, 2024
Merged

perf!(findRoute): return first result #122

merged 3 commits into from
Jul 24, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jul 24, 2024

Internally we store an array of matches because with matchAll, it is possible to match /foo/:bar + /foo/:baz (same method) but for purpose of routing only one route is meaningful to be matchable.

This PR increases perf by %12-17 by avoiding array creation (and also honestly, the DX)

@pi0 pi0 self-assigned this Jul 24, 2024
@pi0 pi0 marked this pull request as ready for review July 24, 2024 14:39
@pi0 pi0 merged commit c13c7ee into main Jul 24, 2024
2 checks passed
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.

1 participant