Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels