You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The matcher implementation always use path-to-regex lib. It is too much for static paths, where it is possible to just compare strings.
Also, the implementatioin is O(N), if you have 100 routes and want to match the last one (that is static), you run 100 regex tests.
Regex is around ~10x slower than a simple string match and with a lookup table it is O(1).
Hello, thank you for taking time filling this issue!
However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).
I hope to see your helper-created issue very soon!
The matcher implementation always use path-to-regex lib. It is too much for static paths, where it is possible to just compare strings.
Also, the implementatioin is O(N), if you have 100 routes and want to match the last one (that is static), you run 100 regex tests.
Regex is around ~10x slower than a simple string match and with a lookup table it is O(1).
vue-router/src/create-matcher.js
Lines 85 to 89 in 5d7afbe
I did the PR #3707 with a draft of my idea.
The text was updated successfully, but these errors were encountered: