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

refactor: fix performance of InputLabel #3662

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

tjaniczek
Copy link
Collaborator

Summary

Another round of performance improvements over TextInput. This time we managed to memoize InputLabel so it does not re-render on each key stroke.

Essentially to do so, I had to inline the parentState and labelProps objects, so that reconciler has a chance to diff changes in props. Previously both objects would be created on each render.

This work results in slower first render (10% comparing to previous) but faster response on each key stroke (by 25%)

Test plan

Click through in the example app. No changes to the previous implementation should occur.

@tjaniczek tjaniczek force-pushed the refactor-input-label-performance branch from c939c2a to 40b7227 Compare February 7, 2023 14:49
@callstack-bot
Copy link

Hey @tjaniczek, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

The mobile version of example app from this branch is ready! You can see it here.

@lukewalczak lukewalczak added this to the 5.3.0 milestone Feb 27, 2023
@lukewalczak lukewalczak merged commit f4c87e9 into main Mar 6, 2023
@lukewalczak lukewalczak deleted the refactor-input-label-performance branch March 6, 2023 09:24
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.

None yet

4 participants