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

perf(Search): Speed up result parsing #408

Merged
merged 1 commit into from
May 20, 2023
Merged

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented May 20, 2023

As we only need the first match, we can do the type check inside the find callback. Doing it like this skips iterating over the entire array with filterType and then again partially with find, as well as the creation of the array that filterType (wraps Array.filter) returns. Now it only has to iterate over the once and only until it finds a match.

@absidue absidue changed the title perf(Search): Speed up results parsing perf(Search): Speed up result parsing May 20, 2023
@LuanRT LuanRT merged commit 1e07a18 into LuanRT:main May 20, 2023
@absidue absidue deleted the perf-search branch May 20, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants