Skip to content
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

Slow performance matching route with localeCompare #406

Closed
chiefcll opened this issue Apr 16, 2024 · 2 comments
Closed

Slow performance matching route with localeCompare #406

chiefcll opened this issue Apr 16, 2024 · 2 comments

Comments

@chiefcll
Copy link

Describe the bug

Matching a segment is taking ~45 ms due to localeCompare. This only happens when deep linking - the base route doesn't have an issue.

image

Your Example Website or App

https://lightning-js.github.io/solid-demo-app/#/browse/movie

Steps to Reproduce the Bug or Issue

Load up the site with 6x slowdown in Chrome - doing the initial match for a route takes ~45ms.

image

Expected behavior

Much faster matching of routes.
https://stackoverflow.com/questions/14677060/400x-sorting-speedup-by-switching-a-localecompareb-to-ab-1ab10
Recommend not using localeCompare

Screenshots or Videos

No response

Platform

Mac, Chrome, latest

Additional context

No response

@ryansolid
Copy link
Member

I'd definitely be open to this. Have you tried this switch yourself in your app?

@chiefcll
Copy link
Author

chiefcll commented May 4, 2024

I haven't tried changing it yet. I assume using normal string comparison is much faster - but some users may need localeCompare. Probably need an option to use one or the other based on if the user needs it - but I assume large percentage of users don't need localeCompare for routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants