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

Suggestion: Improve performance through regex memoization #183

Open
daniellubovich opened this issue Jul 26, 2022 · 0 comments
Open

Suggestion: Improve performance through regex memoization #183

daniellubovich opened this issue Jul 26, 2022 · 0 comments

Comments

@daniellubovich
Copy link

daniellubovich commented Jul 26, 2022

Hey! Recently I've started to hit some performance bottlenecks that seem to be stemming at least partially from route-recognizer. It might be the case that the root of the issue is due to either 1) My application being too large, or 2) ember-source not using the recognizer in the most optimal way, so take whatever I suggest with a grain of salt.

I ran some performance checks when running an acceptance test in Ember. This test loads up all of our routes (we have a lot) at the beginning of the test, and it takes a significant chunk of time. Around 20%.

image

While I do think there could be some optimization elsewhere - it seems like an easy improvement might be to include some memoization for the regex functions in route-recognizer? I could be overlooking some possible downsides here, and I'm not super familiar with this library. Does this seem like a reasonable suggestion?

I did some testing with a local fork and it seemed to have significant improvements on my test execution time. FWIW if this suggestion gets any traction, I'm happy to do the work to implement it.

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

1 participant