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

Improve search screen perf #3752

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Improve search screen perf #3752

merged 7 commits into from
Apr 29, 2024

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Apr 29, 2024

The first few commits extract components with no changes to their logic and add some memos.

The main real change is e46aac2. It renders both the autocomplete and the result list so that switching between those is less laggy. This is especially noticeable on iOS.

Finally, there's a few drive-by changes. 16a13c5 removes subdomain matching — it is not very useful now that we properly rank results, and it looks a bit out-of-place in the list. Also, 36485ea adds some missing hitslops to the recent searches.

Test Plan

The usual for this screen.

bla.mov

Copy link

render bot commented Apr 29, 2024

Copy link

Old size New size Diff
6.44 MB 6.44 MB 22 B (0.00%)

Copy link
Contributor

@haileyok haileyok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing difference.

@gaearon gaearon merged commit 5d715ae into main Apr 29, 2024
6 checks passed
@gaearon gaearon deleted the refactor-search-scr branch April 29, 2024 15:52
@@ -850,6 +864,7 @@ function AutocompleteResults({
</>
)
}
AutocompleteResults = React.memo(AutocompleteResults)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaearon why you dont just wrap the component with memo?
maybe I'm missing some context

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would need a Babel plugin to keep function names readable without adding an extra indentation level due to writing them twice

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense thank you!

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

Successfully merging this pull request may close these issues.

3 participants