Replies: 1 comment 4 replies
-
Yes, it's possible. There are a couple ways that OPFSCoopSyncVFS could eventually use readwrite-unsafe mode: A pretty simple way is to keep everything the same but not open/close the OPFS access handle every time the exclusive lock changes hands. This wouldn't produce any real concurrency - no accesses at the same time - but would improve the performance of multiple connections. Another way is to change from exclusive locking to implement the full SQLite locking model including shared read locks. This would have performance trade offs because each step to a higher locking mode requires a retry, and now that would be three steps instead of one. It would allow multiple concurrent readers, so maybe faster for readers and slower for writers. Even something like WAL is theoretically possible, but I have made a couple attempts at multiple readers with a writer and that is difficult enough without adding retries.
No, at least not that I know of. One question, though, is how much benefit you would get for that investment. JSPI is expected to reach Chrome stable in Q2 (though it was also expected 2024 Q4 and 2025 Q1 🤪) and has been in Firefox Nightly for many months, which would ease some issues with asynchronous builds. I have been a little disappointed with JSPI performance on Chrome, but I haven't looked at it in a while. Additional recent discussion of OPFSCoopSyncVFS is here. |
Beta Was this translation helpful? Give feedback.
-
So far,
OPFSCoopSyncVFS
appears to be a great "default" option for a VFS - it ticks most boxes such as synchronous builds, supports multiple connections, has filesystem transparency.One thing that would be great to add is concurrent read support, and maybe in the future even non-exclusive WAL support. I'm specifically referring to be able to do concurrent reads on different database connections (in different workers), not just having multiple connections open.
I saw the
readwrite-unsafe
mode is used inOPFSPermutedVFS
andOPFSAdaptiveVFS
. It looks like there was also some experimental VFS that used readwrite-unsafe mode.Would it be possible to use
readwrite-unsafe
inOPFSCoopSyncVFS
to get some concurrency support? Is there anything blocking this other than development effort? Of course this would only give concurrency in Chrome, but that would still be valuable (assuming other browsers would fall back to the current behavior).Beta Was this translation helpful? Give feedback.
All reactions