Craticula

Performance

These are measurements of Craticula on one machine, not promises. Nothing here changes how Craticula behaves: the only hard limit on the demos is the two second query cut-off. Every number links to the raw result it came from, and each run lists the command that repeats it.

Measured on bench-vm-10c-34g.

Compile time #

Compiling a request means parsing it, checking it against the schema and building the query. Nothing is executed. The specification sets a target of under 50 µs per typical request (PERF-1). The target is benchmarked, not enforced, and the results below say plainly whether it is met.

The table has two paths. Full compile parses the schema from JSON on every call, as the conformance driver does, because it receives the schema as text with each request. Prepared schema uses a schema built once, which is what a host does: it builds its schema once and compiles every request against it. The second is what a host pays per request. On the full compile path, 3 of 12 measured compile times are not under the target. On the prepared schema path, every measured compile time is under the target.

BackendRequest shapeFull compileAllocatedPERF-1Prepared schemaAllocatedPERF-1
mongodeep-filter37.5 µs17.7 KiBmeets PERF-126.8 µs15.0 KiBmeets PERF-1
postgresdeep-filter35.2 µs13.4 KiBmeets PERF-123.3 µs10.7 KiBmeets PERF-1
searchdeep-filter37.5 µs17.8 KiBmeets PERF-125.5 µs15.1 KiBmeets PERF-1
mongofilter-tree42.6 µs17.7 KiBmeets PERF-118.8 µs12.4 KiBmeets PERF-1
postgresfilter-tree38.9 µs13.9 KiBmeets PERF-115.8 µs8.6 KiBmeets PERF-1
searchfilter-tree40.7 µs15.2 KiBmeets PERF-116.6 µs9.9 KiBmeets PERF-1
mongogroup-aggregate53.1 µs17.2 KiBdoes not meet PERF-113.9 µs10.0 KiBmeets PERF-1
postgresgroup-aggregate51.9 µs15.1 KiBdoes not meet PERF-112.3 µs7.8 KiBmeets PERF-1
searchgroup-aggregate52.3 µs15.0 KiBdoes not meet PERF-112.5 µs7.8 KiBmeets PERF-1
mongoplain-page20.5 µs10.7 KiBmeets PERF-19.7 µs8.0 KiBmeets PERF-1
postgresplain-page17.2 µs6.9 KiBmeets PERF-17.3 µs4.1 KiBmeets PERF-1
searchplain-page17.0 µs6.6 KiBmeets PERF-17.0 µs3.8 KiBmeets PERF-1

Load on the demo API #

A load test posts a mix of grid requests to the demo API on a local stack, without the public rate limit. The table shows latency percentiles and requests per second for each engine and data size.

EngineRowsp50p95p99ThroughputFailed
PostgreSQL through EF Core10k22.0 ms42.3 ms59.8 ms330.6 /s0
MongoDB10k57.9 ms108.0 ms149.4 ms126.0 /s0
PostgreSQL10k18.5 ms39.0 ms52.7 ms381.1 /s0
PostgreSQL through EF Core1m1209.3 ms2639.7 ms3512.5 ms5.6 /s0
MongoDB1m4183.5 ms7860.7 ms7970.5 ms1.5 /s0
PostgreSQL1m1148.3 ms2532.0 ms3480.9 ms6.2 /s0

One client at a time #

The table above has 8 clients sending requests at once on the same machine, so at 1 million rows it includes waiting. These runs use one client, so each number is what a single request costs on an otherwise idle server.

EngineRowsp50p95p99ThroughputFailed
PostgreSQL through EF Core10k11.8 ms16.6 ms19.6 ms85.5 /s0
MongoDB10k26.0 ms43.4 ms52.1 ms34.8 /s0
PostgreSQL10k9.3 ms23.5 ms32.9 ms83.2 /s0
PostgreSQL through EF Core1m294.5 ms428.9 ms483.5 ms3.3 /s0
MongoDB1m1949.4 ms3422.1 ms3429.6 ms0.4 /s0
PostgreSQL1m366.8 ms633.0 ms763.4 ms2.5 /s0

Repeatability #

Every measurement was taken twice on the same machine, in two runs one after the other.

21 of 48 measurements of the repeat run differ by more than 10% from this run.

Largest difference: load ef 10k p99: 59.8 ms then 118.3 ms, 98.1% apart.

Differences above 10%, largest first:

How each result was produced #

Compile benchmark #

To repeat it:

bash scripts/perf-compile.sh perf/results/2026-11-16-p/compile

PostgreSQL through EF Core, 10k rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh ef 10k

MongoDB, 10k rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh mongo 10k

PostgreSQL, 10k rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh postgres 10k

PostgreSQL through EF Core, 1m rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh ef 1m

MongoDB, 1m rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh mongo 1m

PostgreSQL, 1m rows #

To repeat it:

PERF_MACHINE=bench-vm-10c-34g PERF_CONCURRENCY=8 PERF_DURATION=60 PERF_WARMUP=5 PERF_OUT=perf/results/2026-11-16-p bash scripts/perf-load.sh postgres 1m