Open
Description
What problem does this feature solve?
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
What does the proposed API look like?
The API don't change, it is just optimization.
I did a draft PR #3707 to show the idea.
Metadata
Assignees
Labels
No labels