4 ms·
You know what's faster than a local connection to Postgres? Having the database engine directly embedded in your application. No context switch.
by linsomniac 3y ago
You know what's faster than a local connection to Postgres? Having the database engine directly embedded in your application. No context switch.
- hot_gril 3y agoThe overhead of IPC isn't significant here, unless there's some special use case I'm not thinking of. SQLite might still be faster for small queries for other reasons.
- zbentley 3y agoThere are still context switches with sqlite, even in-memory sqlite (it has to mess with files, which means syscalls). Just not network ops.
- kiitos 3y agoIn-memory SQLite doesn't read or write files, and therefore doesn't generate syscalls, by definition.
- deleted 3y ago[deleted]
- zbentley 3y agoFair enough; I didn't realize that ":memory:" SQLite accesses did zero syscalls overall, I had assumed that they required shared memory writes that entailed syscalls for barriers and the like. I'm happy you helped me learn that's not the case! That'll make several things I regularly need to do much, much easier.
- kiitos 3y agoSure! It's a huge and important benefit of that access mode.