-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-04-09] [$500] [Performance] Refactor our current Onyx.connect calls to Reports to include waitForCollectionCallback #38586
Comments
Triggered auto assignment to @isabelastisser ( |
Job added to Upwork: https://www.upwork.com/jobs/~012ebdb211b4ffdbac |
Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new. |
Handled by callstack |
Hey @mountiny, can you please clarify if this is fixed and can be closed? Thanks! |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-09. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
$500 to @shubham1206agra for testing and review, then we can close, thank you! |
Payment Summary
BugZero Checklist (@isabelastisser)
|
Hey @shubham1206agra, sorry for the delay. I hired you in Upwork, please accept it and I will process the payment ASAP. Thanks! |
@isabelastisser I have discussed this internally here. You may close this issue as I am keeping track of payment internally and will ask to pay once the issue is resolved. Just write in the payment summary that I have not been paid yet. |
@isabelastisser You can process payment here now. |
Problem
We have lots of connections to Reports data in Onyx in our utils files and some of them uses waitForCollectionCallback: true and the rest of them don’t. Which adds up to the app startup time. The reason is that when we don’t set waitForCollectionCallback to true in Onyx.js the following code is executed:
This loop will be executed for all the keys and will individually inform the subscriber of updates. The get function first checks whether the value for a key is present in cache and if it doesn’t it then gets it from the storage.
We have 6 connections to Reports without the waitForCollectionCallback so this loop will be executed 6 times. Bearing in mind that Reports can be a huge collection, for eg on a heavy account it can get to 15k reports.
Solution
We can consider to refactor our current Onyx.connect calls to Reports to include waitForCollectionCallback and adjust the code accordingly. There’s one place where we won’t be changing it and that’s in ReportUtils.ts where we have to call handleReportChanged on each report.
One more thing to notice is that currently our cache limit is 10k which is easily hit by a heavy account of 15k reports, so this cache limit isn’t helping the app in case of a heavy account. We can increase it to 20k so that it can hold more reports. Hermes traces are attached in the PR description.
To summarise, When launching the app on Android:
We get 32 seconds of TTI ----- on baseline, which is what we currently have 🔴
We get 25 seconds of TTI ----- with improvements by adding waitForCollectionCallback :large_green_circle:
We get 18 seconds of TTI ----- with increased cache limit to 20k and improvements by adding waitForCollectionCallback :large_green_circle: :large_green_circle:
From: @hurali97
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @isabelastisserThe text was updated successfully, but these errors were encountered: