4 ms·
Is it possible to improve this micro benchmark? Of course, by bundling all the inserts in a single transaction, for example, or by using another, non-async data
by HopenHeyHi 4y ago
Is it possible to improve this micro benchmark? Of course, by bundling all the inserts in a single transaction, for example, or by using another, non-async database driver, but it does not make sense as it's not how a real-world codebase accessing a database looks like. We favor simplicity over theorical numbers.
I don't understand. Using transactions and prepared statements you would get hundreds of thousands of inserts per second even using languages like python/ruby.
Nothing theoretical or not-real-world about it. It is how SQLite docs recommend you do it.
https://www.sqlite.org/faq.html#q19 https://www.sqlite.org/faq.html#q19
https://rogerbinns.github.io/apsw/tips.html#sqlite-is-different https://rogerbinns.github.io/apsw/tips.html#sqlite-is-differ...
- morelisp 4y agoIt would not be real-world in the sense that most OLTP workloads are inserting (or updating) only a couple rows at a time. In this sense it provides an upper bound on transactions per second, which for many real-world workloads essentially means requests per second (or requests*n per second for small n). However, it's still kind of weak because you really need to interleave those with SELECTs and some UPDATEs to get a decent view of how it would perform in such a case.