Benchmarks
swindl against what you would otherwise use, on the same data, with the same questions, all of them durable:
- SQLite with FTS5: a library too, and the yardstick everyone knows.
- PostgreSQL with its full-text search: what most applications would use instead, with a database server to install, secure, back up and upgrade.
- Meilisearch, a search server made for as-you-type search with facets, when it is included (see below): fast search, but your data still needs a store next to it.
The data is a record collection: title, artist, label, genre, country, format, year and notes, generated with a fixed seed. Words follow a Zipf distribution, as in real titles: a few words are in many records, most in few.
Fair to every side.
- All are durable: swindl syncs every transaction to disk (
fsync); SQLite runs in WAL mode withsynchronous=FULL; PostgreSQL withsynchronous_commiton; a Meilisearch write is waited for until its task is done. - All answer with whole objects (the page of 20) and the total number of hits.
- Each has an index for every filter and sort it is asked (genre + year, year, artist),
and full-text search over title, artist and label: an FTS5 table kept up to date by
triggers; a generated
tsvectorcolumn with a GIN index; Meilisearch’s own index with the filters, sorts and facets declared and typo tolerance off. swindl’s model has the same fields in itsINDEX. - PostgreSQL gets what a careful application would do:
VACUUM ANALYZEafter the bulk load (until then its GIN index keeps new entries in a pending list, and a rare word took 4 ms instead of 0.4), and a plan per query (a cached generic plan, made for a common word, scanned everything for a rare one). - A facet (“text + drilldown”) is one query for swindl and Meilisearch; for SQLite and
PostgreSQL it is the page, the count and a
GROUP BYper facet. - Timings are the median of 50 runs after a warm-up; caches are warm for all. PostgreSQL runs on the same machine, over a Unix socket.
What it shows.
- Questions about words (full text, prefixes, facets over many hits) split the field in two. Meilisearch and swindl answer in about a millisecond, also at 100,000 records; the databases take tens of milliseconds there, up to a hundred with facets, and get slower as the data grows. Meilisearch, made for exactly this, is fastest on most of them; swindl is a close second, without a server.
- Exact lookups and sorts on a B-tree index are SQLite’s: fastest, with everyone else within a millisecond. A deep page (page 50) is where Meilisearch is slow.
- Writing is the databases’ strong side. One file per object, synced, costs more
than a row in a page, and a change that must be searchable at once waits for
tantivy’s commit. With the default commit timer a change takes about a millisecond,
and is searchable within 5 seconds. With
Commit(on_search=True)a change takes under a millisecond too, and the next search commits first (one commit for all the changes before it; that search pays it, which this row leaves out): for changes in bursts, it is the fastest way to write that never gives a stale answer. - What you run: swindl and SQLite are libraries. PostgreSQL is a server to install, secure, back up and upgrade. Meilisearch is a server too, and only an index: your data still needs a store next to it, kept in step.
On macOS, a plain fsync does not flush the drive’s own cache; a full sync
(F_FULLFSYNC) does, and costs tens of milliseconds. tantivy always does a full sync, so
on macOS the benchmark makes SQLite (fullfsync) and PostgreSQL
(wal_sync_method = fsync_writethrough, set for the run and set back after) do the
same, for writes that are equally durable. sjdbl’s files use a plain fsync, as the
databases do by default; that is swindl’s “index on the timer” row. On Linux, fsync
flushes the drive’s cache and all of this doesn’t apply.
Run it yourself (the numbers depend most on your disk). PostgreSQL and Meilisearch are included when you give their address:
PYTHONPATH=. python benchmarks/bench.py \
--postgres "host=/tmp dbname=postgres" \
--meilisearch http://127.0.0.1:7700 --meilisearch-key <master key>
Results
Measured 2026-11-16 on arm, 10 CPUs, macOS-26.6.2-arm64-arm-64bit-Mach-O; Python 3.15.2, tantivy 0.27.0, SQLite 3.54.1, PostgreSQL 17.12, Meilisearch 1.57.0. Full syncs (macOS): SQLite with fullfsync, PostgreSQL with wal_sync_method=fsync_writethrough, as tantivy does; sjdbl’s files with a plain fsync. Median of repeated runs, in milliseconds; the fastest in bold.
10,000 records
| Question | hits | swindl | SQLite + FTS5 | PostgreSQL | Meilisearch |
|---|---|---|---|---|---|
| text: a common word | 5,509 | 0.73 | 2.77 | 3.31 | 0.70 |
| text: a rare word | 5 | 0.12 | 0.07 | 0.19 | 0.43 |
| text: two words | 1,837 | 0.69 | 1.04 | 1.10 | 0.76 |
| prefix: 3 letters* | 3,548 | 1.66 | 2.10 | 1.77 | 0.74 |
| filter genre, sort year desc | 1,394 | 0.44 | 0.05 | 0.23 | 0.58 |
| range of years, sort artist | 1,315 | 0.51 | 0.11 | 0.17 | 0.63 |
| text + drilldown (2 facets) | 5,509 | 0.79 | 6.43 | 6.04 | 0.83 |
| page 50, sorted on year | 10,000 | 0.80 | 0.86 | 2.59 | 11 |
| get one object by id | 1 | 0.03 | 0.01 | 0.07 | 0.14 |
| Writing | swindl | SQLite + FTS5 | PostgreSQL | Meilisearch |
|---|---|---|---|---|
| change one object, searchable at once (ms) | 82 | 3.91 | 4.00 | 22 |
| change one object, index on the timer (ms) | 0.81 | - | - | - |
| change one object, index committed by the next search (ms) | 0.46 | - | - | - |
| load, transactions of 1,000 (objects/s) | 4,265 | 39,415 | 18,633 | 22,618 |
| rebuild the search index (s) | 0.8 | 0.01 | 0.02 | - |
| on disk (MB) | 8 | 4 | 6 | 23 |
| what you run | nothing: a library | nothing: a library | a database server | a search server, and a store for the data |
100,000 records
| Question | hits | swindl | SQLite + FTS5 | PostgreSQL | Meilisearch |
|---|---|---|---|---|---|
| text: a common word | 55,071 | 1.33 | 31 | 16 | 0.72 |
| text: a rare word | 46 | 0.44 | 0.11 | 0.24 | 0.64 |
| text: two words | 17,975 | 0.98 | 9.62 | 10 | 0.72 |
| prefix: 3 letters* | 35,423 | 4.27 | 21 | 19 | 0.78 |
| filter genre, sort year desc | 13,867 | 0.55 | 0.20 | 0.57 | 0.62 |
| range of years, sort artist | 13,071 | 1.01 | 0.80 | 0.70 | 0.69 |
| text + drilldown (2 facets) | 55,071 | 1.71 | 70 | 35 | 1.08 |
| page 50, sorted on year | 100,000 | 1.59 | 1.88 | 5.08 | 11 |
| get one object by id | 1 | 0.10 | 0.01 | 0.08 | 0.15 |
| Writing | swindl | SQLite + FTS5 | PostgreSQL | Meilisearch |
|---|---|---|---|---|
| change one object, searchable at once (ms) | 93 | 3.96 | 3.99 | 23 |
| change one object, index on the timer (ms) | 0.89 | - | - | - |
| change one object, index committed by the next search (ms) | 0.69 | - | - | - |
| load, transactions of 1,000 (objects/s) | 3,622 | 15,029 | 23,596 | 17,359 |
| rebuild the search index (s) | 12.6 | 0.11 | 0.12 | - |
| on disk (MB) | 72 | 44 | 57 | 167 |
| what you run | nothing: a library | nothing: a library | a database server | a search server, and a store for the data |