DIM icon indicating copy to clipboard operation
DIM copied to clipboard

Test Origin Private Filesystem for caching manifest / profile

Open bhollis opened this issue 3 years ago • 2 comments

IndexedDB is pretty slow (and slowest in Chrome). There's a new thing called Origin Private Filesystem that might be faster.

bhollis avatar Jun 10 '22 19:06 bhollis

In testing it shaves about 250ms off loading the cached manifest (~600ms instead of ~850ms). Not sure it's worth it.

bhollis avatar Jun 26 '22 02:06 bhollis

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

robojumper avatar Sep 30 '23 20:09 robojumper