Repository navigation
[Performance] localforage.setItem() is causing blocking behavior on init for web clients #7950
Copy link
Copy link
Closed
Labels
EngineeringImprovementItem broken or needs improvement.Item broken or needs improvement.InternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2
Description
Activity
- addedAutoAssignerTriageAuto assign issues for triage to an available triage team memberAuto assign issues for triage to an available triage team memberDailyKSv2KSv2
on Mar 1, 2022 Triggered auto assignment to @CortneyOfstad (
AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.- removedAutoAssignerTriageAuto assign issues for triage to an available triage team memberAuto assign issues for triage to an available triage team member
on Mar 1, 2022 - addedImprovementItem broken or needs improvement.Item broken or needs improvement.
on Mar 1, 2022 Triggered auto assignment to @thienlnam (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Mar 1, 2022 Triggered auto assignment to @dylanexpensify (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.@roryabraham dropped a comment in #expensify-open-source and tagged @kidroca
https://expensify.slack.com/archives/C01GTK53T8Q/p1646173137404599@mallenexpensify am I still good to export this to Upwork?
34 remaining items
- assigned and unassigned
on Mar 14, 2022 - addedInternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffand removedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Mar 14, 2022 - changed the title
[-][$1000] [Performance] localforage.setItem() is causing blocking behavior on init for web clients[/-][+][Performance] localforage.setItem() is causing blocking behavior on init for web clients[/+]on Mar 15, 2022 a fix should be on staging soon.
Reacted by Jack Nam and Rushat GabhaneSeems like changes are on production now gonna close this!
Metadata
Metadata
Assignees
Labels
EngineeringImprovementItem broken or needs improvement.Item broken or needs improvement.InternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2
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