wordplaydev / wordplay

An accessible, language-inclusive programming language and IDE for creating interactive typography on the web.
Other
55 stars 19 forks source link

Slow blocking initial load with a large number of projects #452

Closed amyjko closed 2 months ago

amyjko commented 2 months ago

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:

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.