Open jlongster opened 3 years ago
Hi @jlongster, how about cache the entry
using WeakMap? Or perhaps with TTL or idleTimeout.
For repeat writes, have you tried to re-seek after writing?
I can try it out when I have some time.
It's already cached in openFile
: https://gist.github.com/jlongster/ec00ddbb47b4b29897ab5939b8e32fbe#file-webkitfilesystem-backend-js-L8
I'm going to open a PR with initial implementation though. It's using the sync API which is a lot simpler. Wait until then to start working on it! The code is a lot different
Just opened a PR: https://github.com/jlongster/absurd-sql/pull/13
I have already written a backend using
webkitFileSystem
: https://gist.github.com/jlongster/ec00ddbb47b4b29897ab5939b8e32fbeI did it somewhat naively though. It's way slower because I don't know how to do bulk reads/writes. I can't find anything in the API about it, or any examples. Surely there's a way to avoid doing
entry.file
every single time??https://gist.github.com/jlongster/ec00ddbb47b4b29897ab5939b8e32fbe#file-webkitfilesystem-backend-js-L48Sure you can somehow call
writer.write
more than once? When I tried it, it errored. CallingcreateWriter
each time is super slow! https://gist.github.com/jlongster/ec00ddbb47b4b29897ab5939b8e32fbe#file-webkitfilesystem-backend-js-L36I should probably create a PR so that you already have some running code with it. I'd love for someone to help with it!