Files
turso/perf
Pekka Enberg 0d7ebc500e Merge 'perf/tatp: add the TATP benchmark for SQLite and Turso' from Pekka Enberg
The SQLite VLDB paper (Gaffney et al., "SQLite: Past, Present, and
Future", PVLDB 15) uses TATP as the benchmark for online transaction
processing so let's add that to the tree. The reference TATP is a C
program that talks to the database over ODBC, which Turso does not have,
so we created a Rust version of it to make running it simpler. The
commit also includes a vendored copy of the original TATP sources
(release 1.1.1, Common Public License 1.0, without the prebuilt solidDB
binaries).

The Rust version follows the TATP specification and, where the
specification leaves something open, the reference code: the same
schema, population, non-uniform subscriber keys and 80/20 read/write
transaction mix. It runs SQLite in WAL mode and Turso in MVCC mode with
`BEGIN CONCURRENT`.

`perf/tatp/scripts/run.sh` follows the paper's setup: 10K, 100K and 1M
subscribers, a 10 s warmup and 60 s measured, and a 1 GB page cache per
connection. It runs the paper's single client and also 4 and 16
connections, three runs each, in about two hours plus population. The
main figure draws MQTh (TATP's throughput number) against database size,
one panel per connection count and one bar per engine; the panel for one
connection is the paper's Figure 2. A second figure shows the response
time of each transaction against connections at 100K subscribers.

Each engine's database is populated once per size, and every run starts
from its own copy with the database file in the operating system's
cache. The script asks for the sudo password up front and keeps it
fresh, so a long sweep never stops at a password prompt.

Some things worth knowing:

- SQLite write transactions can wait tens of seconds for the write lock,
  because SQLite's busy handler is not fair to a waiting writer. A write
  that times out starts over, counts as a restart, and keeps the whole
  wait in its response time.
- Populating 1M subscribers takes about 1 minute for SQLite and about 7
  minutes for Turso on a RAM disk.
- The specification says GET_NEW_DESTINATION finds a row 23.9% of the
  time, but its own rules give about 15%, which is what both engines
  measure. The README explains this.
- `perf/tatp/upstream/` is excluded from aristo, which fails on the
  vendored C source because it is not UTF-8.

Closes #9549
2026-10-12 10:56:52 +03:00
..
2026-09-28 17:34:40 +03:00