-
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] localforage.setItem() is causing blocking behavior on init for web clients #7950
Comments
Triggered auto assignment to @CortneyOfstad ( |
Triggered auto assignment to @thienlnam ( |
Triggered auto assignment to @dylanexpensify ( |
@roryabraham dropped a comment in #expensify-open-source and tagged @kidroca |
@mallenexpensify am I still good to export this to Upwork? |
Please do @dylanexpensify , lets start tis one at $1k, I have a feeling it's a significant issue and it's 'performance' so we'd like to get 👀 on it sooner than later |
Possibly related, I'd like to try to test after this issue is fixed to see if can reproduce @dylanexpensify , I posted the job since I was back in here... |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Current assignee @thienlnam is eligible for the Exported assigner, not assigning anyone new. |
📣 @rushatgabhane You have been assigned to this job by @mallenexpensify! |
Reassigning C+ to @rushatgabhane , @Santhosh-Sellavel is starting this/next week |
Triggered auto assignment to @laurenreidexpensify ( |
Reassigning as I'm OOO next week! Thanks Lauren! I'll pick this up when I'm back! |
Going to go ahead and close this then until we run into performance issues again, and can revisit this later |
Linked PRs to fix this are not merged yet so gonna reopen this and assign myself. |
a fix should be on staging soon. |
Seems like changes are on production now gonna close this! |
Creating this in E/App repo from this issue in the E/react-native-onyx repo, in case an external contributor can work on it.
Problem
When the app inits and many keys need to be set things get really slow on web. It currently takes me about 10-12 seconds to switch to a new chat when the app inits.
We've narrowed down the source of the problem to:
setItem()
too many times in a rowAddressing either one should work. Both seem to be causing similar rates of pain.
Solution
More ideas here: https://rxdb.info/slow-indexeddb.html, but the general suggestion is to use fewer transactions. That is not possible with localforage so we might want to look elsewhere - maybe the plugin mentioned here can help localForage/localForage#315
I did a test here where I just made all the writes synchronous (probably not the solution we want), but it improves things immensely
Expensify/react-native-onyx#118
cc @marcaaron
The text was updated successfully, but these errors were encountered: