Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
What performance issue do we need to solve?
We are trying to make Onyx more performant by default. Right now, onyx always starts in a loading state, then collects all the
requested keys and sets them to the component state. This is often times inefficient as all the data is already available in a cache which we can read synchronously.
For exact technical details see: Expensify/react-native-onyx#269
What is the impact of this on end-users?
- Unnecessary loading states: We often start by default in a loading state, although we could show the content right away. Showing the content directly provides better UX
- Performance impacts due to a lot of re-renders: Due to this architecture a component re-renders a lot until it reached its final loaded state. This comes with a performance cost creating janky transitions to screens.
List any benchmarks that show the severity of the issue
See: Expensify/react-native-onyx#269
Proposed solution (if any)
See: Expensify/react-native-onyx#269
Once we have the onyx changes in place we need to update onyx in the app and adjust a few screens to work correctly. Some screens are build with the assumption that we will always start in a loading state.
We will start by adjusting the ReportScreen. The following adjustments need to be made (as discussed here):
- Defer the loading of new chat messages to the next batch, so it doesn’t block the initial rendering by changing a state variable on the report.
- There was recently a
firstRenderRefintroduced, which delays the real rendering of the report screen after it has been mounted. We want to get rid of it to show the available content right away.
List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
See: Expensify/react-native-onyx#269
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: x
Reproducible in staging?: yes
Reproducible in production?: yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
**Issue reported by: @hannojg **
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1688580518417739
Activity
melvin-bot commentedon Jul 11, 2023
Triggered auto assignment to @iwiznia (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.[-][Performance] Show cached onyx content right awak[/-][+][Performance] Show cached onyx content right away[/+]iwiznia commentedon Jul 11, 2023
@hannojg I assume you want this assigned to you since you'll be working on it, right?
hannojg commentedon Jul 12, 2023
Yes, correct, thank you!
hannojg commentedon Jul 17, 2023
The PR is ready for review:
melvin-bot commentedon Jul 20, 2023
@hannojg Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
hannojg commentedon Jul 24, 2023
This is on hold as the work and discussions are happening here:
melvin-bot commentedon Jul 27, 2023
@hannojg Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
27 remaining items
melvin-bot commentedon Aug 6, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)mountiny commentedon Aug 6, 2023
We need to pay $1000 to @mollfpr for their review and testing
slafortune commentedon Aug 11, 2023
Offer sent @mollfpr https://www.upwork.com/nx/wm/offer/26071692
slafortune commentedon Aug 14, 2023
Paid
hannojg commentedon Aug 14, 2023
The original PR for this issue was reverted and the new PR can be found here:
Can we reopen this issue please @slafortune ?e