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
Poor URLPattern performance #19861
Comments
Thanks for flagging it Kit, we actually discussed it last week. We'll look into optimizing it. |
Quick profile from V8 shows that
|
Yeah, I noticed both |
Was looking at a couple of server boot Fresh traces and |
@littledivy is actively looking into improving performance of |
For completeness: The pattern to regex parser I used can be found here https://github.com/denoland/fresh/compare/url-matcher#diff-7d5020e43e696993c4dee3edff778d85149f8165379a8a480824b53dfff7bbdeR1133-R1210 . Mostly used it as a starting point to see how much of a difference there is between a regex and |
On top of raw performance timing, after profiling some isolates in production we suspect that this is also causing a lot of memory pressure.
|
Still an issue. While
|
I was looking at the performance of my oak router versus my acorn router. Oak uses pathToRegex while acorn uses
URLPattern
. The implementation ofURLPattern
in Deno is super non-performant compared to pathToRegex and is making any routers that leverageURLPattern
quite noticeably non-performant against other solutions.By my calculations,
URLPattern
is ~150x slower than pathToRegex when testing/executing.To reproduce:
benchmarks.test.ts
And then:
The text was updated successfully, but these errors were encountered: