DIM
DIM copied to clipboard
Test Origin Private Filesystem for caching manifest / profile
IndexedDB is pretty slow (and slowest in Chrome). There's a new thing called Origin Private Filesystem that might be faster.
In testing it shaves about 250ms off loading the cached manifest (~600ms instead of ~850ms). Not sure it's worth it.
Rescuing (before Slack eats them) some notes by @bhollis from when he implemented OPFS in https://github.com/DestinyItemManager/DIM/tree/opfs:
Looks like it’s faster than IDB for smaller payloads, but then gets slower as the payload gets larger - by the time you hit wishlists and manifest, it’s about 30-50% slower to load
Beyond that there are some kinks: IDB can store Set/Map, OPFS can’t Loading/storing to OPFS requires JSON serialization on the main thread, vs. whatever IDB does off-main-thread There’s no DevTools access to the OPFS state in any browser
Now, on Firefox, OPFS is significantly faster - even a little faster than Chrome’s IDB. Firefox’s IDB is 2-3x slower than Chrome’s Safari issue is that OPFS writes are only supported from a worker context