JSON Schema validators, regex engines and dictionary automata, measured on one machine
A benchmark report from schemaBench
2026-11-21
This report backs the performance claims in Project Delphi: From Definition to Execution: Fast JSON Schema Validation. It covers three tracks, all measured in-process on one machine with one harness:
- Track A, JSON Schema validators (the main result). Oracle’s
jznschemaengine, in two backends, against MongoDB’s real$jsonSchemaengine, Blaze, jsonschema-rs, pg_jsonschema, boon and AJV. - Track B, regex engines.
hotdawg-regex, the derivative-automaton engine jznschema uses forpattern, against the Rustregexcrate, fancy-regex, PCRE2, RE2 and V8. - Track C, dictionary search. hotdawg’s DAWG term dictionary against
fst,tantivy-fst, Lucene 10 and a naive scan.
jznschema and hotdawg are the work of Patrick Meredith, who wrote both engines. schemaBench consumes them at pinned revisions; it does not modify them.
The goal is a reproducible, like-for-like comparison of software components. It is not a comparison of database products. Every number below is recomputed from the result files in results/.
Executive Summary
- Oracle jznschema vs MongoDB
$jsonSchema: 18.4× geomean over the 71 Tier-1 cases both answer correctly, and Oracle is faster on all 71 (interpreted backend). Without the two cases whose MongoDB time is set by its regex match limit, it is 14.6×. The compiled backend is 53.3×. - Against the fastest other engine on each case, the compiled backend is 4.33× faster (wins 141 of 160). The interpreted backend is 1.11× (wins 92 of 160): it is not always the fastest. Blaze beats it on 51 of 158 shared cases, jsonschema-rs on 41.
- Regex-heavy schemas are roughly level. On the 24
regex_*cases the interpreted backend is 0.98× of the fastest other validator (wins 12/24) and the compiled backend 1.07× (wins 13/24). Blaze and jsonschema-rs are faster onuuid,items_patternandlazy_dfa. - MongoDB prepares a schema fastest. Median preparation time per schema, in a fresh process: MongoDB 56 µs, Oracle 150 µs, Blaze 182 µs, jsonschema-rs 868 µs, boon 1.51 ms, AJV 25.9 ms. Oracle’s slowest preparation is 12.5 ms (
wide_late_any_of), where MongoDB takes 0.71 ms. - A regex match limit turned into a wrong answer. On a valid document, MongoDB and Blaze report invalid when PCRE2’s match limit fires. The automaton engines answer correctly in 25–51 ns. AJV answers correctly but takes 31 ms per document.
- Track B: hotdawg-lazy is level with the Rust
regexcrate on everyday patterns (1.02–1.03×) and 1.6–7.4× ahead of the backtracking engines and RE2. It loses to its own DenseMatcher (0.72–0.94×) and, clearly, on the state-explosion casea[ab]{20}c: 7.5 ms vs 94 ns for PCRE2. - Track C: hotdawg is 1.07–3.8× faster than fst, tantivy-fst and Lucene’s FST on lookup, prefix, regex and fuzzy search. Lucene’s BlockTree terms dictionary beats it on regex (0.78×). hotdawg’s structure is 3.0–5.5× larger, builds 3.3× slower than fst, and opens in 0.94–1.7 ms against about 50 ns.
- The harness was checked against the engine authors’ own. Our timings are within 0.98–0.99× of jznschema’s own benchmark for jznschema, jsonschema-rs and boon, and two full runs agree per engine within ±1.1%. Not measured yet: memory, throughput under concurrent load, compatibility-check (schema-vs-schema) performance, and detailed-error-report mode.
What the article asks of a benchmark, and the evidence
The article’s section Show the cost of checking every order sets out what good measurements must show. This table maps each point to what schemaBench measured, and says where the evidence stops.
| The article asks for | What we measured | Gaps |
|---|---|---|
| Preparation reported separately from repeated checks | Preparation (nsCompileMedian): median time to prepare each schema once, in a fresh driver process, per case and engine. Repeated checks: time per document with an already-prepared validator. Shown side by side in The cost of checking every order and in a separate table. | The compiled backend is prepared ahead of time by code generation and a native build; that build time is not timed. Process start-up and cold-cache effects are not measured. pg_jsonschema prepares on every call by design, so it has no separate figure. |
| Equivalent work: JSON text or parsed data | Every engine receives a document already parsed into its own native form (serde_json::Value, BSON for MongoDB,sourcemeta::core::JSON for Blaze, a JS object for AJV). Parsing is built once and not timed. | Parse cost is excluded for all engines. An end-to-end “JSON text to verdict” figure is not measured. |
| Equivalent work: which checks are enabled | Every keyword in each schema is evaluated; nothing is disabled. Regex engines keep their library defaults, including PCRE2’s match limit, and a limit that fires is reported as an outcome, never hidden. | None known. |
| Equivalent work: pass/fail or a detailed report | Pass/fail only, for every engine. | Detailed-error-report (diagnostics) mode is not measured. |
| Representative inputs: sizes, valid and invalid, dependency complexity | 160 cases: 148 from jznschema’s own benchmark set plus 12 cross-engine probes. Most come as valid/invalid pairs. They cover objects, arrays, scalars, unions, $refrecursion, $dynamicRef, unevaluated*, conditionals and 24 regex cases. A growth curve tests input length up to 128 characters on a backtracking pattern. | Documents are small (micro-benchmark sized). There is no sweep over large documents or large schemas, and schema/document sizes are not tabulated per case. |
| Engine settings, hardware | Versions, pins, toolchains, CPU, OS and pinning are listed in Machine and run discipline and Versions and pins. | None known. |
| Latency | Median, p95 and IQR per document, per case and engine (in results/results.csv). | Single-threaded latency only; no latency under load. |
| Memory use | Not measured. | Memory is not measured. |
| Concurrency, throughput as traffic increases | Single core, serial. Throughput is reported as validations per second on one core. | Throughput under concurrent load is not measured. |
| Compatibility checks measured separately | Not measured. | Schema-vs-schema compatibility checking is not measured. |
| Reproducible | Pinned revisions, one command per track, two full Track A runs agreeing per engine within ±1.1%, and timings within 0.98–0.99× of the engine author’s own harness. | Results are from one machine. |
| No required checks turned off | A correctness gate runs before any timing. A wrong verdict removes that row from every speed comparison and is reported. | None known. |
The four items marked not measured are listed again, with next steps, in the What was not measured section below.
Machine, run discipline and reproducibility
| CPU | AMD Ryzen 7 9700X (8 cores / 16 threads) |
| OS | WSL2, Linux 6.6.87.2-microsoft-standard-WSL2 |
| Pinning | every timed run is pinned to one core with taskset -c 6; runs are serial, on an otherwise quiet machine |
| Toolchain | Node v22.18.0 (V8 12.4.254.21), Rust stable, Java HotSpot 23.0.2 |
| Pins | jznschema 54a986d; hotdawg-regex a10b0d8 (Tracks A, B); hotdawg ff9f225 (Track C) |
Baseline. All three tracks were run on this machine on 2026-11-21. Numbers from earlier versions of this work (June: 6.2× over MongoDB, 103 cases) are not comparable: the hardware, the corpus (now 160 cases) and every engine version changed.
How the comparison is kept fair

How the benchmark keeps the comparison fair: one corpus with exact verdicts; one driver process per engine that prepares once and validates many times on a pre-parsed document, pass/fail only; a correctness gate before any timing; 5 pinned trials; and a parity check against the engine author’s own harness.
Each driver is a separate process that speaks JSON lines to the orchestrator. It prepares the schema once, then runs a black-boxed validate-many loop over the pre-parsed document and times the loop itself, so process start-up and IPC are outside the measured region.
Statistics. Each (case, engine) pair gets 5 trials, with warmup dropped; the median, p95 and IQR are recorded. Loops are capped at 50,000 iterations; ns/op is a rate, so the cap does not bias it. “Fastest other” means the fastest non-Oracle engine on that case, among gate-passing rows.
Run-to-run reproducibility
Track A was run in full twice, before and after preparation time was added to the output (the timing code did not change). Per engine, the geomean of (second run ÷ first run) per case:
| Engine | Cases | Second ÷ first run (geomean) |
|---|---|---|
| Oracle jznschema (interpreted) | 160 | 0.996 |
| Oracle jznschema (compiled) | 160 | 0.997 |
| Blaze | 158 | 0.989 |
MongoDB $jsonSchema | 71 | 1.010 |
| jsonschema-rs | 158 | 1.006 |
| boon | 158 | 0.990 |
| AJV | 152 | 0.991 |
| pg_jsonschema | 158 | 0.992 |
Every engine agrees within ±1.1%. Of the 1,175 individual rows, 1,096 (93%) are within ±10%; the largest single-row swings are on AJV (0.38–1.34×), which runs under a JIT.
Harness validation
Before any cross-engine number was published, our per-engine timings were checked against the engine author’s own benchmark harness (jznschema’s bench/sweep) on the same machine. That check found two biases in our harness. Both were fixed before the final run.
serde_json/arbitrary_precisionleaked across the Cargo workspace. The pg-jsonschema driver enabled the feature, and Cargo unifies features across a workspace, so every serde-based driver (Oracle, jsonschema-rs, boon) parsed and validated arbitrary-precision numbers. The pg-jsonschema replica no longer enables it, so no Rust driver uses it.- The
{v: …}root wrap was sent to every engine. MongoDB’s$jsonSchemaonly validates document roots, so scalar and array instances are wrapped as{v: …}for MongoDB. That wrapped form went to every engine. On the 70 unwrapped cases our timings already matched (1.00×); on the 78 wrapped cases jsonschema-rs and boon were 1.44× and 1.46× slower than upstream. The wrap is now MongoDB-only.

Harness parity at three stages. A ratio is our median ns ÷ the upstream harness’s ns per case, as a geomean. After both fixes all three engines are within 0.98–0.99× of upstream.
| Engine | Upstream harness | Cases | First run | After arbitrary-precision fix | Final run |
|---|---|---|---|---|---|
| Oracle jznschema (DecisionGraph) | jznschema bench/sweep(dgraph.csv) | 148 | 0.95× | 0.94× | 0.98× |
| jsonschema-rs 0.46.5 | jznschema bench/sweep(rustlibs.csv) | 148 | 1.46× | 1.21× | 0.99× |
| boon 0.6.1 | jznschema bench/sweep(rustlibs.csv) | 146 | 1.32× | 1.22× | 0.99× |
| hotdawg-lazy, schema strings (Track B) | hotdawg bench/baseline.tsv | 11 | 1.02× | ||
| hotdawg, dictionary search (Track C) | hotdawg bench/baseline.tsv | 19 | 0.95× |
The first-run and final-run columns are recomputed from the saved result files; the middle column is from the run log. The run before preparation time was recorded gave 0.99× / 0.99× / 1.00×. hotdawg’s baseline.tsv was recorded on a different machine, so ±10% is the expected band for the last two rows.
Track A: JSON Schema validators
Engines
| Validator | Version | Language | Document form | Engine |
|---|---|---|---|---|
| Oracle jznschema (interpreted) | 54a986d | Rust | serde_json::Value | DecisionGraph (interpreted compiled graph); regex via hotdawg-regex a10b0d8 |
| Oracle jznschema (compiled) | 54a986d | Rust → native | serde_json::Value | DecisionGraph lowered to generated Rust and compiled ahead of time to machine code |
MongoDB $jsonSchema | 7.0 | C++ | BSON | the real server InternalSchema*MatchExpression tree, linked in-process via stitch_support, nomongod; regex via PCRE2 |
| Blaze (SourceMeta) | 7b214cf (= CLI 15.11.0) | C++ | sourcemeta::core::JSON | compiled to an instruction template (FastValidation); regex via statically linked PCRE2 |
| jsonschema-rs | 0.46.5 | Rust | serde_json::Value | Draft 2020-12; regex via the Rust regex crate |
| pg_jsonschema(Postgres) | jsonschema 0.46 | Rust | serde_json::Value | Supabase’s extension engine as jsonb_matches_schemacalls it: compiles the schema on every call; engine only, no Postgres server |
| boon | 0.6.1 | Rust | serde_json::Value | Draft 2020-12; regex via the Rust regex crate |
| AJV | 8.20.0 | JS | JS object | Draft 2020-12, schema compiled to a function; regex via V8 irregexp |
Corpus: 160 cases
- 148 cases come verbatim from jznschema’s
codegen_benchmark_cases(), dumped bydrivers/rust/extract-casestocorpus/jznschema_cases.json. - 12 are local cross-engine probes:
$dynamicRefnested-id and override probes, acyclic-ref microbenchmarks, and theregex_backtrack_limit_*pair.
| Family | Cases |
|---|---|
| unevaluated* | 44 |
| scalar/coverage | 24 |
| array | 24 |
| regex | 24 |
| union-dispatch | 15 |
| dynamicRef | 8 |
| anyOf | 7 |
| object | 5 |
| conditional | 5 |
| ref | 4 |
MongoDB’s $jsonSchema implements a Draft-4 subset plus bsonType, so the corpus is split into two tiers. The split is derived, not asserted: a case is Tier-1 if and only if a strict allowlist translator can produce a faithful MongoDB schema (type/integer → bsonType, const → enum, numeric exclusiveMin/Max → the Draft-4 boolean form, dependentRequired/dependentSchemas →dependencies, pattern passed through).
- Tier-1, comparable on MongoDB: 72 cases, including 22 of the 24 regex cases.
- Tier-2: 88 cases using
unevaluated*,$ref/recursion,$dynamicRef,if/then/else,prefixItems,containsorpropertyNames. MongoDB is N/A on all of them by design.
Correctness gate
Before any timing counts, every engine’s verdict is compared with each case’s expected verdict. The gate collects disagreements rather than aborting.
- Oracle interpreted and Oracle compiled match the expected verdict on all 160 cases. MongoDB matches on 71 of its 72 Tier-1 cases.
- There are 9 verdict mismatches (
results/gate_mismatches.json):
| Engine | Case | What happened |
|---|---|---|
| Blaze | dynamic_ref_success | Expected valid; Blaze says invalid. Oracle (both backends) and boon say valid. |
| AJV | oson_unevaluated_items_contains_failure | Wrong verdict on cooperative unevaluatedItems. |
| AJV | oson_unevaluated_items_anyof_cooperative_success | Same as above. |
| jsonschema-rs | dynamic_ref_nested_id_scope_success | A $dynamicRef inside a nested $idresource must still see the outer dynamic scope. |
| jsonschema-rs | dynamic_ref_nested_id_scope_failure | Same as above. |
| pg_jsonschema | dynamic_ref_nested_id_scope_success | Same engine as jsonschema-rs, same failure. |
| pg_jsonschema | dynamic_ref_nested_id_scope_failure | Same as above. |
| MongoDB | regex_backtrack_limit_success | Expected valid; MongoDB says invalid when its regex match limit fires (see below). |
| Blaze | regex_backtrack_limit_success | Same as MongoDB. |
- There are 8 errors: AJV rejects relative
$dynamicRefURI forms (4) and overflows the stack on the acyclic$dynamicRefcases (2); boon rejectsregex_lookahead_password_*at compile time because its regex dialect has no lookahead (2).
On the $dynamicRef probes, boon is the only non-Oracle engine that clears every case.
The cost of checking every order
The article frames performance as “what does validating every incoming order add?”. To answer it with corpus data, we picked six Tier-1 cases whose schemas look like parts of an order contract, and show the two costs separately: checking one document with a prepared validator, and preparing the schema in the first place.

The cost of checking every order. Top: time per document on six order-shaped schemas. Bottom: preparation time for the same six schemas, once per schema, in a fresh process.
The six cases (all valid documents):
| Label in the figure | Case id | Schema |
|---|---|---|
| required, typed fields | object_required_typed_success | {"type":"object","required":["a","b"],"properties":{"a":{"type":"integer"},"b":{"type":"integer"}}} |
| card number ⇒ billing fields | oson_dependent_required_success | {"type":"object","dependentRequired":{"credit_card":["billing_address","billing_zip"]}} |
| number in range | scalar_number_bounds_success | {"type":"number","minimum":1,"maximum":10} |
| string length | scalar_string_length_success | {"type":"string","minLength":3,"maxLength":8} |
| UUID pattern | regex_uuid_success | {"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"} |
| wide object + additionalProperties | wide_additional_properties_success | 20+ declared integer properties,additionalProperties: {"type":"string"} |
Median time per document:
| Case | Oracle compiled | Oracle interpreted | Blaze | jsonschema-rs | boon | MongoDB | AJV |
|---|---|---|---|---|---|---|---|
object_required_typed_success | 2.2 ns | 13 ns | 7.5 ns | 18 ns | 89 ns | 97 ns | 98 ns |
oson_dependent_required_success | 2.6 ns | 15 ns | 14 ns | 17 ns | 39 ns | 82 ns | 83 ns |
scalar_number_bounds_success | 0.6 ns | 2.4 ns | 9.4 ns | 5.8 ns | 19 ns | 105 ns | 73 ns |
scalar_string_length_success | 4.0 ns | 2.4 ns | 6.1 ns | 8.4 ns | 20 ns | 105 ns | 87 ns |
regex_uuid_success | 34 ns | 36 ns | 22 ns | 48 ns | 63 ns | 165 ns | 101 ns |
wide_additional_properties_success | 29 ns | 77 ns | 513 ns | 228 ns | 1.3 µs | 3.5 µs | 304 ns |
What it shows:
- On these schemas every engine checks a document in nanoseconds to a few microseconds.
- Among the engines that prepare at runtime, Oracle interpreted is fastest on three of the six (number range, string length, wide object). Blaze is faster on the other three: required typed fields (7.5 ns vs 13 ns), card ⇒ billing fields (14 ns vs 15 ns) and the UUID pattern (22 ns vs 36 ns).
- MongoDB is the slowest per document on four of the six and within 1% of AJV on the other two, but it is the fastest to prepare (median 52 µs over these six schemas, against 96 µs for Oracle and 111 µs for Blaze).
- The compiled backend has no runtime preparation step: its validator is generated as Rust and compiled ahead of time. That build is a separate, offline cost and is not timed here.
Preparation, reported separately
Median preparation time per schema, measured once per case in a fresh driver process:
| Engine | All cases it runs (n) | Median | Min – max | Tier-1 common cases (n) | Median |
|---|---|---|---|---|---|
MongoDB $jsonSchema | 72 | 56 µs | 38 µs – 711 µs | 71 | 56 µs |
| Oracle jznschema (interpreted) | 160 | 150 µs | 63 µs – 12.5 ms | 71 | 116 µs |
| Blaze | 160 | 182 µs | 60 µs – 16.3 ms | 71 | 163 µs |
| jsonschema-rs | 160 | 868 µs | 766 µs – 1.53 ms | 71 | 866 µs |
| boon | 158 | 1.51 ms | 1.34 ms – 4.36 ms | 69 | 1.52 ms |
| AJV | 154 | 25.9 ms | 23.8 ms – 124 ms | 71 | 25.3 ms |
| Oracle jznschema (compiled) | — | ahead of time | not timed | — | — |
| pg_jsonschema | — | on every call | included in each check | — | — |
MongoDB prepares a schema fastest, on the whole corpus and on the cases both engines share. Oracle and Blaze have the same worst case, wide_late_any_of (a wide anyOf of deep objects): 12.5 ms for Oracle and 16.3 ms for Blaze, against 0.71 ms for MongoDB. jsonschema-rs and boon spend most of their preparation on fixed set-up (their minimum is above 0.7 ms), and AJV generates and compiles JavaScript.
Where the break-even falls: per Tier-1 case, Oracle’s extra preparation time over MongoDB divided by its per-document saving is a median of about 330 documents (60 of 71 cases break even within 1,000 documents, all 71 within 9,000). A long-running service that prepares each contract once pays it once. A short-lived process that prepares a schema for a handful of documents does better with MongoDB’s faster preparation.
Scorecard

Scorecard: jznschema compiled and interpreted against each named engine, geomean over the cases both engines pass, with win counts.
| vs | n | Oracle compiled | Oracle interpreted |
|---|---|---|---|
| Fastest other engine, per case | 160 | 4.33×, wins 141 | 1.11×, wins 92 |
| Blaze | 158 | 7.72×, wins 151 | 1.96×, wins 107 |
| jsonschema-rs | 158 | 6.27×, wins 147 | 1.65×, wins 117 |
| AJV | 152 | 28.6×, wins 149 | 7.54×, wins 134 |
| boon | 158 | 36.6×, wins 158 | 9.22×, wins 155 |
MongoDB $jsonSchema (Tier-1) | 71 | 53.3×, wins 71 | 18.4×, wins 71 |
| pg_jsonschema (recompiles per call) | 158 | 1,128×, wins 158 | 297×, wins 158 |
Against the fastest other engine, split by tier:
| Oracle compiled | Oracle interpreted | |
|---|---|---|
| Tier-1 (72) | 3.30×, wins 60 | 1.16×, wins 41 |
| Tier-2 (88) | 5.42×, wins 81 | 1.06×, wins 51 |
Compiled vs interpreted Oracle, all 160 cases: 3.91×.
Oracle vs MongoDB

Oracle jznschema vs MongoDB per category: geomean speedup with case counts. Two regex cases are bound by MongoDB’s match limit.
| Headline | Value |
|---|---|
| Oracle interpreted vs MongoDB, Tier-1 | 18.4× geomean over 71 cases, faster on all 71 (1.50×–73,299×; median 12.8×) |
| … without the 2 limit-bound cases | 14.6× geomean over 69 cases |
| Oracle compiled vs MongoDB, Tier-1 | 53.3× geomean |
The comparison covers 71 of the 72 Tier-1 cases. regex_backtrack_limit_success is left out because MongoDB’s verdict on it is wrong, and gate-failing rows are never timed against. Two of the 71 are timed by MongoDB’s match limit rather than by matching: regex_nested_quantifier_failure (73,299×) and regex_backtrack_limit_failure (58,586×). In both, the verdict is right but PCRE2 reaches it by hitting its limit. Without them the regex category falls from 17.5× to 7.4×.

Throughput by category


On the Tier-2 cases MongoDB is N/A by design, and the point there is coverage. The compiled backend leads in almost every category. The interpreted backend is competitive but not always fastest; on scalar/coverage and regex, several engines are within a small factor of each other.
Regex slice: where Oracle is not ahead

On the 24 regex_* cases, the interpreted backend comes in at 0.98× of the fastest other validator and wins 12/24; the compiled backend comes in at 1.07× and wins 13/24. On the original 22 cases (without the backtrack_limit pair), the figures are 0.95× and 1.07×. The fastest other is usually Blaze (PCRE2) or jsonschema-rs (the Rust regex crate).
- Losses (interpreted).
pattern_properties_wide ✗(0.55× vs AJV),uuid(0.56–0.61×),items_pattern(0.57–0.58×),lazy_dfa ✓(0.70×),nested_quantifier ✓(0.77×), andsearch_long,email ✓,lazy_dfa ✗at 0.80–0.90×. The compiled backend turnsitems_patterninto a win (1.16–1.25×) but still losesuuid(0.61–0.64×). - Wins.
lookahead_password(1.16–1.58× interpreted, 1.25–1.84× compiled),any_of_patterns(1.40–1.43×; compiled 2.00–2.02×),unicode_property ✗(1.48×),pattern_properties_wide ✓(1.42×),property_names_wide(1.30–1.32×), andbacktrack_limit(1.29–1.30×).
Backtracking growth curve
{"type":"string","pattern":"^(a+)+$"}, the shape of regex_nested_quantifier_failure, is validated against "a"×n + "!"(always invalid) at n ∈ {8, 12, 16, 20, 24, 28, 32, 40, 64, 128}, on every Track A engine except pg_jsonschema. Each (engine, n) gets a calibration trial and then 5 timed trials (3 above 1 s per document). An engine is stopped when a document takes more than 5 s or when growth from the previous n predicts it would. Every engine returned invalid at every measured n.
| engine | n=8 | 12 | 16 | 20 | 24 | 28 | 32 | 40 | 64 | 128 |
|---|---|---|---|---|---|---|---|---|---|---|
| Oracle interpreted | 11 ns | 13 ns | 18 ns | 21 ns | 24 ns | 28 ns | 31 ns | 38 ns | 70 ns | 165 ns |
| Oracle compiled | 9 ns | 11 ns | 16 ns | 19 ns | 22 ns | 25 ns | 28 ns | 35 ns | 65 ns | 162 ns |
| jsonschema-rs | 18 ns | 21 ns | 24 ns | 27 ns | 32 ns | 38 ns | 42 ns | 50 ns | 76 ns | 153 ns |
| boon | 73 ns | 81 ns | 83 ns | 87 ns | 90 ns | 94 ns | 99 ns | 109 ns | 135 ns | 205 ns |
| AJV (V8) | 706 ns | 11.1 µs | 175 µs | 2.80 ms | 44.7 ms | 716 ms | capped | capped | capped | capped |
| MongoDB (PCRE2) | 4.7 µs | 74.3 µs | 1.20 ms | 1.45 ms | 1.45 ms | 1.44 ms | 1.46 ms | 1.46 ms | 1.44 ms | 1.45 ms |
| Blaze (PCRE2) | 441 ns | 6.9 µs | 110 µs | 1.75 ms | 8.35 ms | 8.34 ms | 8.39 ms | 8.28 ms | 8.35 ms | 8.34 ms |

- The automaton engines are linear: Oracle (both backends, via hotdawg-regex), jsonschema-rs and boon (both on the Rust
regexcrate), at 9–205 ns per document even at n=128. - AJV grows by 16× every 4 characters and would take about 11 s per document at n=32.
- MongoDB and Blaze flatten out, and the flat part is not a fast path. It is PCRE2’s match limit firing: MongoDB levels off at 1.45 ms from n=20, Blaze at 8.3 ms from n=24. Both link PCRE2, and Track B shows PCRE2 hitting its default match limit on this exact pattern from n=24. On this schema “does not match” happens to be the right verdict, so the gate passes.
Regex match limits: a check that could not run reported as “invalid”
When PCRE2’s match limit fires, MongoDB and Blaze report the document invalid, including when it is valid. This is a measured corpus result. The probe pair regex_backtrack_limit_* uses {"type":"string","pattern":"^(?:(a+)+b|a+)$"}:
"a"×24is valid: the first alternative backtracks exponentially and fails, thena+matches."a"×24 + "!"is invalid.

| case | expected | Oracle | Oracle compiled | jsonschema-rs | boon | AJV | MongoDB | Blaze |
|---|---|---|---|---|---|---|---|---|
regex_backtrack_limit_success | valid | valid, 26 ns | valid, 32 ns | valid, 33 ns | valid, 51 ns | valid, 31.4 ms | invalid, 1.42 ms | invalid, 8.0 ms |
regex_backtrack_limit_failure | invalid | invalid, 25 ns | invalid, 33 ns | invalid, 33 ns | invalid, 90 ns | invalid, 31.8 ms | invalid, 1.46 ms | invalid, 8.8 ms |
pg_jsonschema (the same engine as jsonschema-rs, recompiling per call) answers both correctly in 15–17 µs.
- The automaton engines answer in tens of nanoseconds; there is no match limit to hit.
- AJV (V8, a backtracker with no limit) is right on both but takes about 31 ms per document.
- MongoDB and Blaze stop at the same limit-bound times as on the growth curve and give the wrong answer on the valid document. Both rows are in
gate_mismatches.jsonand excluded from every speed comparison. We observe the verdict; that the engines map the limit error to “no match” is inferred from behaviour, not from reading their source.
The same behaviour at other lengths, from an untimed probe (node scripts/redos-failclosed.mjs '^(?:(a+)+b|a+)$') on"a"×n:
| n | Oracle | jsonschema-rs | boon | Blaze | MongoDB | AJV |
|---|---|---|---|---|---|---|
| 10 | valid | valid | valid | valid | valid | valid |
| 20 | valid | valid | valid | valid (2.1 ms) | invalid (1.45 ms) | valid (2.0 ms) |
| 30 | valid | valid | valid | invalid (8.1 ms) | invalid (1.4 ms) | valid (2.0 s) |
On this shape a backtracking engine either blows up (AJV) or, with a limit, returns an answer that was never computed (MongoDB, Blaze). The article’s rule applies: a check that could not run is a different outcome from a validation failure, and should be reported as one.
pg_jsonschema (Postgres)
pg_jsonschema is Supabase’s Postgres extension. Its jsonb_matches_schema(schema, instance) calls jsonschema::is_valid, which recompiles the schema on every call. We benchmark that engine path in-process, without a Postgres server.
- It is 180× slower (geomean) than the same engine used compile-once (jsonschema-rs), over 158 shared cases.
- Its median is about 0.16M validations per second, the slowest in the comparison.
- A real in-database measurement would add SPI, JSONB detoast and FFI costs on top.
- It has the same nested-id
$dynamicRefgate failures as jsonschema-rs.
Disclosed caveats
- Representation. MongoDB validates BSON; the Rust and JS engines validate parsed JSON. Each document is built once in each engine’s native form, untimed. For scalar and array roots, MongoDB alone gets the
{v: …}wrap. - Number typing.
bsonTypechecks type tags strictly. The BSON encoder pins integer and double typing in lockstep with the translator, and the gate checks agreement on every document. - MongoDB is 7.0, built from source (
stitch_support). Newer MongoDB releases were not measured. - Small documents. The corpus documents are small, so these are per-check costs, not a model of a full order pipeline.
Track B: regex engines
Question. jznschema validates pattern with hotdawg-regex, a DFA built from Brzozowski derivatives. How does it compare with the regex engines other validators and databases use?
| Engine | Version | Kind | Used by |
|---|---|---|---|
| hotdawg-lazy (reference) | hotdawg-regex a10b0d8 | lazy DFA (LazyDfa), ECMA syntax | jznschema |
| hotdawg-dense | hotdawg-regex a10b0d8 | DFA built ahead of time (DenseMatcher, 100k-state budget) | — |
Rust regex | 1.13.2 (regex-automata 0.4.19) | hybrid NFA / lazy DFA, no backtracking | jsonschema-rs, boon |
| fancy-regex | 0.20.2 | backtracking for lookaround and backrefs; default backtrack limit | — |
| PCRE2 (JIT) | 10.42 | backtracking, JIT, default match limit | MongoDB, Blaze |
| PCRE2 (interpreter) | 10.42 | backtracking, default match limit | — |
| RE2 | 2024-07-02 (abseil 20240722.0) | automaton, no lookaround | — |
| V8 irregexp | 12.4.254.21 (Node v22.18.0) | backtracking, JIT | AJV |
Patterns are written in ECMA-262 and translated per engine. If a translation cannot express a construct (for example lookaround onregex or RE2), the result is recorded as unsupported, never as zero matches.
Workloads: 117 cases, generated deterministically by a byte-for-byte port of hotdawg’s data generators at a10b0d8:
| Workload | Cases | What |
|---|---|---|
| schema strings | 41 | the jznschema regex_* patterns plus hotdawg’s schema set (date, phone, uuid, email, semver, identifier, \p{L}, lookaround, …) over 200,000 structured strings, about half valid; ns per string |
| text search | 51 | 17 patterns × {scan 20 MB of pseudo-English, per line (293,719 lines), per word (10,185 words)} |
| backtracking blow-ups | 24 | 4 groups (nested +, alternation, words, *-of-*) × n ∈ {16, 20, 24, 28, 32, 1000}; 5 s/test cap with growth prediction |
| state explosion | 1 | a[ab]{20}c over a 20 KB a/b input; a full DFA needs about 2²⁰ states |
Gate. Every engine’s match count must equal hotdawg-lazy’s. Result: 0 mismatches. Other outcomes are their own categories, never misses: limit (the engine’s own backtrack/match limit fired; PCRE2 and fancy-regex keep library defaults), capped (the 5-second rule), unsupported.
Results

Engine time ÷ hotdawg-lazy time, geomean over gate-passing cases (above 1× = hotdawg-lazy faster; (k/N) = engine finished k of N):
| Engine | schema strings | text search | backtracking | state explosion (absolute) |
|---|---|---|---|---|
| hotdawg-dense | 0.92× | 0.94× | 0.72× | unsupported (state budget) |
Rust regex | 1.03× (37/41) | 1.02× | 0.81× | 22 µs |
| fancy-regex | 1.63× | 1.68× (50/51) | 1.08× | 22 µs |
| PCRE2 JIT | 1.63× | 3.02× | 191× (15/24) | 284 ns |
| PCRE2 interpreter | 2.29× | 7.38× | 468× (14/24) | 94 ns |
| RE2 | 1.56× (37/41) | 2.89× | 1.54× | 6.68 ms |
| V8 | 1.67× | 5.23× | 131,578× (17/24) | 375 µs |
| hotdawg-lazy (absolute) | 2–34 ns per string | 7.54 ms |

- hotdawg-lazy is level with the Rust
regexcrate on schema strings and text (1.02–1.03×) and ahead of every backtracking engine and RE2 (1.56–7.38×). On backtracking patterns the automaton engines stay linear; PCRE2 hits its match limit on 8–10 of the 24 cases and V8 is capped on 7. - hotdawg-lazy is not the fastest automaton. hotdawg’s own DenseMatcher beats it on every workload it can build (0.72–0.94×), and the
regexcrate beats it on the backtracking set (0.81×). - State explosion is a clear loss. On
a[ab]{20}chotdawg-lazy takes 7.5 ms; PCRE2 takes 94 ns (interpreter) and 284 ns (JIT), theregexcrate 22 µs, V8 375 µs. A backtracker finds the early match at once, while a lazy DFA keeps building new states. DenseMatcher refuses the pattern (more than 100k states). - The backtracking geomeans for PCRE2 and V8 cover only the lengths they finished.
- Unicode: hotdawg reports Unicode 16.0.0 and V8 16.0;
\p{…}cases agree on every count.
Track C: dictionary search
Question. hotdawg also provides a DAWG term dictionary with regex, fuzzy, phonetic and accent-folded search. How does it compare with the FST libraries search engines use?
| Engine | Version | Structure |
|---|---|---|
| hotdawg (reference) | git ff9f225 | DAWG; Dawg, MutableDawg, Trie, snapshot + delta merge |
| fst | 0.4.7 (regex-automata 0.1.10) | FST Set, with regex and Levenshtein automata |
| tantivy-fst | 0.5.0 (levenshtein_automata 0.2.1) | tantivy’s fork, Map from term to ordinal |
| Lucene 10 FST | lucene-core 10.6.0, Java 23.0.2 | FSTCompiler (BYTE1, NoOutputs), walked by DFS × ByteRunAutomaton |
| Lucene 10 terms | lucene-core 10.6.0 | an index term dictionary (BlockTree),Terms.intersect |
| naive (correctness oracle) | regex 1.13.2, rphonetic 4.0.1 | sorted Vec<String> and a full scan |
JVM: -Xms4g -Xmx4g -XX:+UseParallelGC; Lucene drivers warm up until the coefficient of variation over the last 5 runs is under 5%.
| Dataset | Terms | Source |
|---|---|---|
| synthetic | 300,000 | hotdawg bench_suite dictionary() |
| english | 370,105 | dwyl words_alpha.txt (Unlicense), downloaded, never committed |
| synthetic-mixed, english-mixed | same | every 3rd term accented, every 5th capitalised (folded search) |
Operations: build, size, open, encode/decode, exact lookup, prefix enumeration, regex search, fuzzy search at d=1 and d=2 (with and without transpositions), folded search, Soundex and Metaphone, trie insert, 10k-term update and folded batches, and snapshot+delta merged search: 468 rows. Query times include building the automaton.
Gate. Each engine’s sorted result set is SHA-256 hashed and compared with the naive scan’s. Result on hotdawg ff9f225: 0 mismatches (316 ok rows, 152 unsupported).
Results

Engine time ÷ hotdawg time, geomean over gate-passing rows on both dictionaries (above 1× = hotdawg faster):
| Operation | fst | tantivy-fst | Lucene FST | Lucene terms | naive |
|---|---|---|---|---|---|
| exact lookup | 1.23× | 1.28× | 2.07× | 3.59× | 1.65× |
| prefix | 1.59× | 2.03× | 3.76× | 3.13× | 0.03× |
| regex | 2.19× | 3.17× | 2.44× | 0.78× | 1.92× |
| fuzzy | 1.67× (no transpositions only) | 1.07× | 1.77× | 1.60× | 149× |
| 10k update batch | 0.88× (rebuild) | 0.94× (rebuild) | 1.32× (rebuild) | n/a | 0.07× |
| 10k folded batch | 1.11× | 1.17× | 1.65× | n/a | 0.08× |
| build | 0.31× | 0.31× | 0.56× | n/a | 0.03× |
| open | 0.00004× (42–58 ns vs 0.94–1.7 ms) | 0.00004× | 0.08× | n/a | 8.74× |
Phonetic and folded operations have no counterpart in the other engines, so hotdawg is compared only with the naive scan there: Soundex 1,170×, Metaphone 18.8× and fold 29× faster.


- Where hotdawg wins. Lookup, prefix, regex and fuzzy against fst, tantivy-fst and Lucene FST: 1.07–3.76×. It is the only engine here with query-time phonetic search, query-time folded search and incremental update.
- Lucene’s BlockTree terms dictionary beats hotdawg on regex search (0.78×).
- Rebuilding is faster than hotdawg’s incremental update at this batch size: a full fst rebuild costs 0.88× of hotdawg’s 10k-term update, tantivy-fst 0.94×; a sorted
Vecmerge 0.07×. The mutable path buys flexibility, not speed. - hotdawg’s structure is larger and slower to build. 16.9 MB against 3.1 MB for fst on synthetic, and 4.9 MB against 1.4–1.7 MB on English: 3.0–5.5× the fst and Lucene FST size, and larger than the raw term bytes. Build is 3.3× slower than fst (520 ms vs 114 ms on synthetic) and 1.8× slower than Lucene. fst and tantivy-fst open in 41–58 ns (a zero-copy view); hotdawg takes 0.94–1.7 ms.
- Not supported elsewhere. Lucene’s
&(intersection) and~(complement) regex syntax is benchmarked as hotdawg-only. fst’s Levenshtein has no transposition mode, so fst runs only 8 of the 16 fuzzy cases.
Metaphone: found by the gate, fixed upstream in ff9f225
- What the gate found. On hotdawg
a10b0d8, the gate flaggeddawg/metaphone/shaker. hotdawg encoded a word-initialCH+ vowel asX, where Apache commons-codec (and rphonetic 4.0.1, used by the naive engine) givesK. Sochackercame out asXKRinstead ofKKR, and a search forshaker(XKR) returned it: 22 results against 15 on synthetic, 46 against 14 on English. - Fix. Reported as hotdawg issue #1 and fixed in
ff9f225(“Metaphone: word-initial CH before a vowel encodes as K”), which also corrected theshakercheck value in hotdawg’s ownbench/baseline.tsvfrom 22 to 15. - Re-run. On
ff9f225hotdawg returns 15 and 14, matching the naive oracle. The gate is clean. Tracks A and B stay on hotdawg-regexa10b0d8: between the two revisions theregex/crate is byte-identical.
What was not measured
The article asks for these, and this benchmark does not yet provide them:
| Not measured | Why it matters | Next step |
|---|---|---|
| Memory use | The article asks what validation adds to memory, not only to time. | Record peak RSS per driver after preparation and during the validate loop, and the size of each prepared validator. |
| Throughput under concurrent load | Results should show what happens as traffic increases. Everything here is one thread on one pinned core. | A multi-threaded validate loop (1, 2, 4, 8 threads) sharing one prepared validator, reporting throughput and p95/p99 latency. |
| Compatibility checks (schema vs schema) | The article says comparing two schema versions is a separate job and needs separate measurements: which comparisons resolve, how long they take, how useful the explanations are. | A corpus of schema pairs with expected verdicts, including cases that cannot be decided, timed separately from document validation. |
| Detailed-error-report (diagnostics) mode | Every engine here returns pass/fail only. A full error report costs more, and engines differ in what they report. | Re-run the invalid half of the corpus with each engine’s error-collecting API, timed and compared for content. |
| End-to-end “JSON text to verdict” | Parsing is excluded for every engine. | Time parse + validate from the same bytes. |
| Large documents and schemas | The corpus documents are small. | A size sweep over document and schema size. |
| Ahead-of-time build cost of the compiled backend | It is a real cost, paid offline. | Time code generation and the native build per schema. |
Versions, pins, licensing and how to reproduce
Versions and pins
| Component | Version / pin |
|---|---|
| Oracle jznschema (both backends) | 54a986d |
| hotdawg-regex (Tracks A, B) | a10b0d8 |
| hotdawg (Track C) | ff9f225 |
MongoDB stitch_support | 7.0 |
| Blaze | 7b214cf (= CLI 15.11.0) |
| jsonschema-rs | 0.46.5 |
| boon | 0.6.1 |
| AJV | 8.20.0 |
Rust regex | 1.13.2 (regex-automata 0.4.19) |
| fancy-regex | 0.20.2 |
| PCRE2 | 10.42 |
| RE2 | 2024-07-02 (abseil 20240722.0) |
| V8 | 12.4.254.21 (Node v22.18.0) |
| fst / tantivy-fst | 0.4.7 / 0.5.0 |
| Lucene | lucene-core 10.6.0 (Java HotSpot 23.0.2) |
Licensing
schemaBench is Apache-2.0. Every engine is consumed, never vendored: each is built from a pinned source on the user’s machine and talks to the orchestrator over stdin/stdout.
| Component | License | How it is consumed |
|---|---|---|
| jznschema | no license file (Oracle research artifact) | git dependency at a pinned rev |
| hotdawg / hotdawg-regex | no LICENSE file (publish = false) | git dependency at pinned revs; never redistributed |
MongoDB stitch_support 7.0 | SSPL v1 | separate executable (../mongoJsonValidator) |
| Blaze | AGPL-3.0 | separate executable (../blazeJsonValidator) |
| PCRE2 | BSD-3-Clause (pcre2-sys: Unlicense OR MIT) | system/bundled library |
| RE2 + abseil | BSD-3-Clause / Apache-2.0 | built from source |
| fst, tantivy-fst | Unlicense / MIT | crates.io |
| levenshtein_automata, fancy-regex | MIT | crates.io |
Rust regex | MIT OR Apache-2.0 | crates.io |
| rphonetic | Apache-2.0 | crates.io |
| Lucene 10 | Apache-2.0 | Maven |
| V8 (via Node) | BSD-3-Clause | the Node runtime |
| jsonschema-rs, boon, AJV | MIT / MIT OR Apache-2.0 / MIT | crates.io, npm |
dwyl words_alpha.txt | Unlicense | downloaded at build time, never committed |
How to reproduce
npm install && npm run build
source scripts/env.sh # before any cargo command
(cd drivers/rust && cargo build --release)
./drivers/rust/target/release/extract-cases > corpus/jznschema_cases.json
node dist/corpus/generate.js # corpus/corpus.json (160 cases)
./drivers/rust/target/release/oracle-compiled-gen && (cd drivers/rust/compiled-bench && cargo build --release)
# MongoDB (../mongoJsonValidator) and Blaze (../blazeJsonValidator) drivers: see their build/ scripts.
taskset -c 6 node dist/src/cli.js run # Track A -> results/results.{json,csv}, gate_mismatches.json
taskset -c 6 node dist/src/cli.js run --track a-redos # growth curve -> results/redos.{json,csv}
drivers/cpp/re2-driver/build-re2.sh # RE2 driver (Track B)
taskset -c 6 node dist/src/cli.js run --track b # Track B -> results/regex/
scripts/dict/fetch-data.sh # Track C datasets
(cd drivers/java/lucene-dict-driver && mvn -q -B package)
taskset -c 6 node dist/src/cli.js run --track c # Track C -> results/dict/
python3 charts/render.py # report charts
python3 charts/article_figs.py # article figures (set JZN_SWEEP_RESULTS to recompute parity)
pandoc report/FULL_REPORT.md --embed-resources --standalone --toc --toc-depth=2 \
--css report/report.css --resource-path=report:. -o "schemaBench - Fast Validator Benchmark Report.html"
Full per-row data is in the results.{json,csv} file under each results/ directory, with metadata (versions, host, dataset hashes) in each JSON. Disagreements are in each gate_mismatches.json.
schemaBench benchmark report, 2026-11-21. jznschema and hotdawg are by Patrick Meredith.
