Export improvements #400
Export improvements #400
Conversation
Regarding the test failure:
Looking through emscripten issues it looks like there have been various fun moments with getTempRet0/setTempRet0 over the years |
The issue55 test is the one in particular that tests this part of the code, I would like to make sure it passes before merging.
|
Yeah, I’m trying to figure out how to make emscripten include env.getTempRet0 in the sql-asm.js target output. If I copy the implementation from one of the other files it passes. Also, VACUUM can take some time and possibly lock up UI or workers. Do you have any concerns with changing the implementation in such a way?
I’ll give this a try, too. Having way too much fun with things! |
@kripken Since this was/is your baby, do you have any opinions on exporting and in-memory vs filesystem? And if you have any getTempRet0 tricks up your sleeve... |
I think going directly to memory might be better than using a filesystem, yeah. Could be much faster to just malloc some room and use that. For
|
For what it's worth, I would love to avoid the overhead of the virtual FS and just tell SQLite that it's writing to memory. Thank you for exploring this @seidtgeist! |
Based on #302 I’ve been trying to improve export, and this has lead me on a path™. Have you considered using one of these options?
VACUUM INTO
a temporary file that’s read, unlinked and returnedIn this PR, I’m giving (1) a shot. I’m very interested to hear what you have to say. Ultimately, option (2) might be better suited for a generic
export
function since it doesn’t incur a VACUUM, and I will most likely give that a try as well.On a related note: Since the current filesystem is MEMFS, have you considered just using an in-memory database instead? Right now, sqlite believes it’s writing to a persistent filesystem, but MEMFS is backed by memory. Since everything’s happening in-memory anyway, why not use sqlite’s native memory-backed mechanics and drop the MEMFS indirection along the way?
I have no experience with IDBFS (#397), and boy would I prefer if we had something like NativeIO.
Some notes to self: