I ran the same 5,000 SQLite inserts two ways in Node.js and the difference was not small. Full run in this Short: https://youtu.be/-xqnLIvmZTQ
The numbers
Inserting 5,000 rows one by one took 1,263 ms. Wrapping the same inserts in a single transaction took 6 ms. That is about 200x faster, from adding two words: BEGIN and COMMIT.
Why a transaction is so much faster
By default, SQLite treats every single insert as its own transaction, and every transaction ends with a commit that forces data to disk. So 5,000 inserts one by one means 5,000 separate commits, and the disk flush dominates everything else.
Wrap the batch in BEGIN and COMMIT and you get one commit for all 5,000 rows. The inserts themselves barely change; the 5,000 disk flushes become one. The work that survives is the work that was always fast.
The rule of thumb
Any time you insert, update, or delete more than a handful of rows, wrap the batch in a transaction. It costs two lines and it is often the single biggest SQLite speedup available. Inside the transaction, prepare the statement once and bind parameters per row, so SQLite skips re-parsing the SQL too.
Watch the run
The real benchmark output is in the Short: https://youtu.be/-xqnLIvmZTQ (narration is AI-generated; the test output is from a real run). The full build is here: https://youtu.be/vOOsCOFnxqU
Subscribe to Ship Stack AI on YouTube and tell me in the comments what to build and break next.

