Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're assuming that URLPattern is performant... That doesn't seem to be the case currently.

https://adventures.nodeland.dev/archive/you-should-not-use-u...

https://github.com/denoland/deno/issues/19861





URLPattern can be plenty fast if you use them in a fast data structure, like a prefix tree as pointed out in that first link. And there's no reason why URLPattern can't do that.

So I went and made an implementation of URLPatternList that uses a prefix tree and is 20-30x faster than a linear scan for large lists of URLPatterns: https://github.com/justinfagnani/url-pattern-list


> assuming that URLPattern is performant

Whose implementation, specifically? I don't think as specified URLPattern has any inherent performance drawbacks compared to the alternatives, but it seems like V8/NodeJS/Deno definitely didn't thought closely and/or clearly about performance when they did theirs.


All three of those use the same implementation. I would hope that this will be improved over time, but it's not a guarantee by any stretch of the imagination.

Thanks, I wasn't sure, as I thought Deno used V8 but then the issue linked earlier shared "The implementation of URLPattern in Deno is super non-performant" so it seemed to me like Deno maybe had their own implementation instead of using the V8 one.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: