Another possibility is that ProjectsDatabase is doing something inefficient with project loading. For example, on getting the initial snapshot of data, track() is called for each project, which refreshes the editable projects store. That only seems to be used on the projects page though, so that shouldn't be an issue.
ProjectsDatabase.track is also being called many times per project. That may result in a lot of redundant updates.
There are many tutorial projects that are loaded and saved. They're not particularly helpful to have in memory unless in the tutorial. We could avoid loading those until they're needed.
I tracked it down to our use of IndexedDB. When we first create the Database interface, we load all projects from the local database into memory, and whenever we persist to the database, we save all projects to the local database. Since those saves can happen frequently, and our local database saves don't check to see if the value has changed, that's a lot of saving.
Expected behavior
When loading the homepage, with a logged in user with many projects, the page should load, and projects should load in the background.
Actual behavior
Instead, the page hangs while data is being loaded.
Environment
Desktop
Cause
Possible causes:
One possibility might be Firestore's cold start issue.
Another possibility is that
ProjectsDatabase
is doing something inefficient with project loading. For example, on getting the initial snapshot of data,track()
is called for each project, which refreshes the editable projects store. That only seems to be used on the projects page though, so that shouldn't be an issue.ProjectsDatabase.track
is also being called many times per project. That may result in a lot of redundant updates.There are many tutorial projects that are loaded and saved. They're not particularly helpful to have in memory unless in the tutorial. We could avoid loading those until they're needed.
I tracked it down to our use of
IndexedDB
. When we first create theDatabase
interface, we load all projects from the local database into memory, and whenever we persist to the database, we save all projects to the local database. Since those saves can happen frequently, and our local database saves don't check to see if the value has changed, that's a lot of saving.