-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Performance] Refactor withWindowDimensions
to drop event subscription in each instance.
#4121
Comments
Triggered auto assignment to @sakluger ( |
Thanks @parasharrajat this sounds pretty similar to the issue opened here by @kidroca (which we ended up not prioritizing). Are you proposing something different?
What are the impacts? Is it something we can benchmark and prove? And is it something we should prioritize? |
Also is there some specific experience metric we can tie this to and apply it as a solution... e.g. does it make chat switching faster? Does it make the app boot faster? Does it make report actions load faster? These are the areas we are prioritizing. So it would be nice see this presented as a solution to one of our open issues. |
ok. I will try to match it with something but I guess we can close it and continue there if there is an existing issue. Please feel free to close it if you agree. |
Let me know how it goes. I've put a Planning label on this for now and raised some discussion in Slack. I think a good issue title should be something like:
|
Actually going to close this. If you have some new metrics or benchmarks feel free to reopen the other issue. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
ISSUE
withWindowDimensions
subscribe to Dimensionchange
directly in each instance. There is no apparent issue with this. But It is really not necessary and delays react updates. This component will cause a series change in React components instead they can be updated at once.There is also a performance drop due to having multiple subscriptions. I suggest we use Context-based state sharing for this. This is a new pattern for our app. But we already using with some vendor Libs already.
There are some good points by @jsamr #4106 (comment) & #4106 (comment). A little more context #4106 (comment). There was an old case where the app crashed due to this #2902.
I insist to do this change as if there is a way to improve this code and it is giving an advantage without too much overhead then we should do this.
Expected Result:
Describe what you think should've happened
Remove multiple Dimension change subscriptions.
Platform:
Where is this issue occurring?
Web ✔️
iOS ✔️
Android ✔️
Desktop App ✔️
Mobile Web ✔️
Version Number: latest
View all open jobs on Upwork
cc: @marcaaron
The text was updated successfully, but these errors were encountered: