From 26933bc5618247612ff5a2faa912ca68da050ccc Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Mon, 30 Nov 2026 15:05:59 +0530 Subject: [PATCH] docs(bench): refresh the performance envelope for the 3.0.0-alpha (#942) Replace the #551 envelope snapshot with a run at bcd74572b (Rust 1.99.1, 100K/1M/10M, one NUMA node of an idle benchmark server), add a comparison against #551 and #306/#530, and update the README summary and the ROADMAP re-audit line. Closes #942. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H2a7QngaFzuCVt5umd1qoh --- README.md | 20 +++--- ROADMAP.md | 2 +- docs/BENCHMARKS.md | 171 ++++++++++++++++++++++++++++++++------------- 3 files changed, 133 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index b8e410136a..5795247334 100644 --- a/README.md +++ b/README.md @@ -293,19 +293,19 @@ See [ROADMAP.md](ROADMAP.md) for planned work and current direction. ## Performance -Performance measurements for the v3 release (format v8), taken during development at up to 10M facts on an otherwise idle server over two rounds (see [BENCHMARKS.md](docs/BENCHMARKS.md#executor-removal-551) for every shape, RSS and the method): +Performance measurements for the v3.0.0-alpha release (format v8), refreshed on 2026-11-30 at `bcd74572b` with Rust 1.99.1, up to 10M facts on an otherwise idle dedicated benchmark server pinned to one NUMA node (see [BENCHMARKS.md](docs/BENCHMARKS.md#performance-envelope-v300-394) for every shape, RSS and the method): | Workload | 100K facts | 1M facts | 10M facts | |---|---:|---:|---:| -| Point lookup (bound entity + attribute, incl. `:as-of` / `:valid-at`), p50 / p99 | 18–21 µs / 25–39 µs | 18–20 µs / 22–37 µs | 18–20 µs / 22–27 µs | -| Entity with 1,000 versions, p50 / p99 | 0.29–0.30 / 0.31–0.35 ms | 0.29–0.30 / 0.30–0.36 ms | 0.29–0.30 / 0.32–0.37 ms | -| Open a file (RSS after open: 3 MiB) | 0.12–0.16 ms | 0.25–0.27 ms | 0.13–0.23 ms | -| Checkpoint after 1 new fact, p50 / p99 | 0.7–0.9 / 1.4–1.6 ms | 0.9–1.8 / 2.7–2.8 ms | 1.1–1.5 / 2.2–2.9 ms | -| Attribute scan (N/6 rows) drained in batches of 1,000, p50 | 23 ms | 0.25 s | 2.5 s | -| Selective 2-clause join (1 row), p50 | 38 µs | 37 µs | 37 µs | -| Rule query with a constant (magic sets, 5–7 rows), p50 | 1.1 ms | 1.5 ms | 1.9 ms | - -The table above is the #551 snapshot. A later [focused UUID projection comparison](docs/BENCHMARKS.md#projected-uuid-lookup-batching-530-unreleased) measures the 1M-fact attribute scan at 262 → 136 ms p50 after batched dictionary reads (#530); the other table scales were not remeasured in that comparison. +| Point lookup (bound entity + attribute, incl. `:as-of` / `:valid-at`), p50 / p99 | 20–23 µs / 30–34 µs | 17–19 µs / 32–34 µs | 17–19 µs / 32–35 µs | +| Entity with 1,000 versions, p50 / p99 | 0.24 / 0.28–0.29 ms | 0.22 / 0.24–0.25 ms | 0.22 / 0.25 ms | +| Open a file (RSS after open: 3 MiB) | 0.144 ms | 0.255 ms | 0.409 ms | +| Checkpoint after 1 new fact, p50 / p99 | 0.712 / 1.22 ms | 0.942 / 1.97 ms | 1.09 / 3.30 ms | +| Attribute scan (N/6 rows) drained in batches of 1,000, p50 | 10.79 ms | 0.117 s | 1.18 s | +| Selective 2-clause join (1 row), p50 | 43 µs | 34 µs | 35 µs | +| Rule query with a constant (magic sets, 5–7 rows), p50 | 1.07 ms | 1.35 ms | 1.81 ms | + +The table above is the #942 alpha snapshot. [Changes since the previous snapshot](docs/BENCHMARKS.md#changes-since-the-previous-snapshot) compares it with #551 and the later partial #530 measurements, including the slower file open and tail latencies at 10M. Point lookups, time travel on one entity, and joins and rule queries that a constant makes selective stay flat at every tested size. Queries that read a whole attribute (scans, aggregates, joins with nothing selective) grow linearly with the facts they read, in bounded memory: the 1.67M-row scan at 10M facts holds one batch, 7 MiB. Windows and whole transitive closures hold their rows, and `OpenOptions::query_memory_limit` stops a query that passes it with `QRY-012`. Graphs over 10M facts are not tested. diff --git a/ROADMAP.md b/ROADMAP.md index 51dd41e0c9..b2d41ff21e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -228,7 +228,7 @@ Completed — testing and documentation: - Manual migration evidence (#838): native v7-to-v8 through 200k facts; Chromium/Firefox/WebKit through 20k facts, with separate read-only/reopen controls and bounded post-migration cursor churn. [Results, frozen fixtures and exclusions](docs/benchmarks/838-migration/README.md); no new nightly route or sustained-pin bound. - Semantic permutations (#842): [correctness-target map and control limits](docs/benchmarks/842-semantic-permutations/README.md) for X07. The exclusion stands; no nightly route or acceptance gate is added. - Failure paths (#843): [correctness-target map](docs/benchmarks/843-failure-correctness/README.md) for X08. The benchmark exclusion stands; #865 closed the heavy WAL replay gap with the passing `one_million_fact_wal_entry_replays_on_open` acceptance test. -- Release-cut feature re-audit (#844): [every production change since the measured revision, with its benchmark disposition](docs/bench-coverage-v3.md#release-cut-feature-re-audit-844), at v3 head `33b4b165c`. OPFS (#441) is excluded and carried to v3.next with the profiler (#185) and rule persistence (#241); no nightly route or gate changes. +- Release-cut feature re-audit (#844): [every production change since the measured revision, with its benchmark disposition](docs/bench-coverage-v3.md#release-cut-feature-re-audit-844), at v3 head `33b4b165c`. The alpha performance envelope was refreshed at `bcd74572b` on 2026-11-30 (#942; [snapshot](docs/BENCHMARKS.md#performance-envelope-v300-394)). OPFS (#441) is excluded and carried to v3.next with the profiler (#185) and rule persistence (#241); no nightly route or gate changes. - Manual shape evidence (#841): [native shape sweeps, recursive controls and sustained-reader experiments](docs/benchmarks/841-shape-sweeps/README.md), with explicit input, timeout and attribution limits. The small-nightly recommendation is separate from execution; this audit adds no nightly route or release-acceptance gate. - Expression keyword/ref equality (#774; on `v3`): resolve literal keywords once per operator, with memory bounded by the expression. [Measurements and regression coverage](docs/benchmarks/774-expression-keywords.md); performance-only, with no v2.x backport. - Higher storage/WAL coverage gates and branch-coverage gates (#396; on `v3`: line and branch floors per file in `coverage-thresholds.toml`, checked on every PR) diff --git a/docs/BENCHMARKS.md b/docs/BENCHMARKS.md index 681989503d..63dfce327e 100644 --- a/docs/BENCHMARKS.md +++ b/docs/BENCHMARKS.md @@ -785,82 +785,155 @@ half-frame cost. The one-partition prefix remains manual. ## Performance Envelope (v3.0.0, #394) -**Version**: `v3` branch (format v8), unreleased · **Date**: 2026-10-11 · **Command**: `cargo run --profile envelope --example perf_envelope -- --scales 100k,1m,10m` · Intel Core i7-1065G7 (4 cores / 8 threads, 16 GB RAM), Rust 1.94.0, Linux 6.12.108, on AC power and otherwise idle; the `.graph` file on an SSD with the OS page cache warm. +**Version**: `v3` branch (format v8), v3.0.0-alpha snapshot (#942) · **Commit**: `bcd74572b` · **Date**: 2026-11-30 · **Toolchain**: Rust 1.99.1 · **Command**: `cargo run --profile envelope --example perf_envelope -- --scales 100k,1m,10m`. -This section lists the graph sizes and query shapes that are tested, with their p50 and p99 latency, and the ones that are not supported yet. Re-run it for each minor release (CONTRIBUTING.md). +One run on an otherwise idle dedicated benchmark server, CPU and memory bound to the same NUMA node; load average 0.26 before the run. Only docs/CI changed between the measured commit and the alpha preparation head. This refresh replaces the current envelope figures; the historical A/B studies below retain their original measurements. Re-run the envelope for each minor or major release (CONTRIBUTING.md). ### What is supported -Every query runs on the streaming engine since #551. The figures in this table are from the #551 A/B on an idle server (below); the storage and latency tables after it are the laptop run of 2026-10-11, before the engine. +Every query runs on the streaming engine since #551. All figures in the following storage, latency and RSS tables are from this alpha run. | Workload | Tested up to | p50 / p99 at 10M facts | Notes | |---|---:|---:|---| -| Point lookup: bound entity and attribute, including `:as-of` a counter and `:valid-at` | 10M facts | 18–20 µs / 22–27 µs | Flat from 100K to 10M | -| Point lookup `:as-of` a time | 10M facts | 0.92 ms / 0.93–0.96 ms | Resolving the time reads the DICT's transactions: 0.7 ms at 100K | -| Entity with a long history (1,000 versions), current and `:as-of` | 10M facts | 0.29–0.30 ms / 0.32–0.37 ms | Grows with that entity's history, not the graph | -| Attribute + value, joins that probe by entity or value | 10M facts | 17 µs–0.2 ms | `attribute_value`, `join_2`, `join_3_selective` | -| Open a checkpointed file | 10M facts | 0.13–0.23 ms, 3 MiB RSS | Indexes are paged in on demand | -| Checkpoint after 1 new fact | 10M facts | 1.1–1.5 ms / 2.2–2.9 ms | Copy-on-write: cost follows the change | -| Attribute scan, aggregates, `not`, `or`, joins that scan | 10M facts | see below | Linear in the facts they read, in bounded memory: 0.3–0.9 s for `not`/`or`/`count_grouped`, 2.5 s for a 1.67M-row scan in 7 MiB, 13 s for `join_3_scan` in 62 MiB | -| Rule queries (recursion) | 10M facts | see below | A rule with a constant (magic sets) takes 1.9 ms; a whole transitive closure grows with the facts it derives, about 5 µs and 250 bytes of RSS per derived fact | -| Window functions | 10M facts | 5.9–6.0 s | A window holds its whole input: 0.9 GiB for 1.67M rows | +| Point lookup: bound entity and attribute, including `:as-of` a counter and `:valid-at` | 10M facts | 17–19 µs / 32–35 µs | Flat from 100K to 10M | +| Point lookup `:as-of` a time | 10M facts | 0.98 ms / 1.03 ms | Resolving the time reads the DICT's transactions: 0.71 ms at 100K | +| Entity with a long history (1,000 versions), current and `:as-of` | 10M facts | 0.22 ms / 0.25 ms | Grows with that entity's history, not the graph | +| Attribute + value, joins that probe by entity or value | 10M facts | 16–181 µs / 32–228 µs | `attribute_value`, `join_2`, `join_3_selective` | +| Open a checkpointed file | 10M facts | 0.41 ms, 3 MiB RSS | Indexes are paged in on demand | +| Checkpoint after 1 new fact | 10M facts | 1.09 ms / 3.30 ms | Copy-on-write: cost follows the change | +| Attribute scan, aggregates, `not`, `or`, joins that scan | 10M facts | see below | 0.26–0.73 s for `not`/`or`/`count_grouped`, 1.18 s for a 1.67M-row scan in 7 MiB, 11.74 s for `join_3_scan` in 56 MiB | +| Rule queries (recursion) | 10M facts | see below | A rule with a constant (magic sets) takes 1.81 ms; the whole transitive closure takes 44.76 s and 2,539 MiB for 10,555,551 rows | +| Window functions | 10M facts | 5.50 s / 6.10 s | This unpartitioned window holds its whole input: 876 MiB for 1.67M rows | **Not supported yet:** - Graphs over 10M facts are not tested. -- Interactive latency for queries that read a whole attribute at 10M facts: 0.3–14 s. Their memory is bounded per operator, except windows and rule relations, which hold their rows; `OpenOptions::query_memory_limit` stops a query that passes it with `QRY-012` (#549). +- Interactive latency for queries that read a whole attribute at 10M facts: 0.26–11.74 s in these shapes. Windows and rule relations hold their rows; `OpenOptions::query_memory_limit` stops a query that passes it with `QRY-012` (#549). ### Storage | Metric | 100K | 1M | 10M | |---|---:|---:|---:| | File size | 10 MiB | 120 MiB | 1,202 MiB | -| Build time (200-entity transactions, checkpoint every 200K facts) | 3.2 s | 12.7 s | 195 s | -| Build peak RSS | 185 MiB | 403 MiB | 421 MiB | -| Open | 120 µs | 136 µs | 124 µs | +| Build time (200-entity transactions, checkpoint every 200K facts) | 1.13 s | 10.70 s | 136.26 s | +| Build peak RSS | 185 MiB | 391 MiB | 417 MiB | +| Open | 144 µs | 255 µs | 409 µs | | RSS after open | 3 MiB | 3 MiB | 3 MiB | -| Checkpoint, 1 new fact (p50 / p99) | 3.1 ms / 5.1 ms | 2.9 ms / 4.3 ms | 3.8 ms / 20.5 ms | -| Checkpoint, 10K new facts | 41 ms | 83 ms | 722 ms | -| Peak RSS (open + 21 checkpoints) | 20 MiB | 21 MiB | 21 MiB | +| Checkpoint, 1 new fact (p50 / p99) | 712 µs / 1.22 ms | 942 µs / 1.97 ms | 1.09 ms / 3.30 ms | +| Checkpoint, 10K new facts | 45.06 ms | 111.65 ms | 309.08 ms | +| Peak RSS (open + 21 checkpoints) | 20 MiB | 21 MiB | 20 MiB | ### Query latency (p50 / p99) | Shape | Query | 100K | 1M | 10M | |---|---|---:|---:|---:| -| `point_entity` | `[:p{m} :age ?a]` | 13 µs / 16 µs | 12 µs / 48 µs | 12 µs / 46 µs | -| `as_of` | `:as-of {tx}`, `[:p{m/4} :age ?a]` | 14 µs / 36 µs | 14 µs / 20 µs | 14 µs / 30 µs | -| `valid_at` | `:valid-at "2021-06-01…"`, `[:p{m} :status ?s]` | 15 µs / 49 µs | 14 µs / 20 µs | 14 µs / 23 µs | -| `hot_current` | `[:hot :counter ?v]`, 1,000 versions | 263 µs / 301 µs | 256 µs / 293 µs | 268 µs / 300 µs | -| `hot_as_of` | same, `:as-of` halfway | 257 µs / 284 µs | 262 µs / 293 µs | 264 µs / 304 µs | -| `attribute_value` | `[?e :name "p{m}"]` (1 row) | 24.5 ms / 25.6 ms | 288 ms / 297 ms | 3.16 s / 3.16 s | -| `attribute_scan` | `[?e :age ?a]` (N/6 rows) | 43.4 ms / 49.4 ms | 462 ms / 484 ms | 4.83 s / 5.18 s | -| `count_grouped` | `[:find ?g (count ?e) :where [?e :group ?g]]` | 46.3 ms / 48.6 ms | 521 ms / 524 ms | 5.66 s / 6.20 s | -| `limit` | `[:find ?e ?a :where [?e :age ?a] :limit 10]` (#306) | 307 µs / 502 µs | 317 µs / 348 µs | 318 µs / 391 µs | -| `join_2` | `[:p{m} :follows ?f] [?f :name ?n]` (1 row) | 54.0 ms / 63.0 ms | 606 ms / 610 ms | 6.50 s / 7.02 s | -| `join_3_selective` | `[:p{m} :manager ?b] [?s :manager ?b] [?s :name ?n]` (10 rows) | 117 ms / 125 ms | 1.24 s / 1.28 s | 13.5 s / 13.8 s | -| `join_3_scan` | `[?e :follows ?f] [?f :group 7] [?f :name ?n]` | 150 ms / 155 ms | 1.92 s / 1.96 s | 20.9 s / 21.2 s | -| `recursive_ancestors` | `(boss :p{leaf} ?b)` over `:manager` (5–7 rows) | 2.71 s / 2.72 s | 40.1 s / 40.8 s | > 60 s (abandoned) | - -These are the executor's figures, before the streaming engine; the engine's are in the sections below, and every shape on today's code in [Executor removal (#551)](#executor-removal-551). `recursive_ancestors` at 1M was measured after the #528 fix, on the same machine and fixture. Below 100 runs, p99 is the slowest run. Shapes slower than about 75 ms ran fewer than 200 times; the full JSON report has run counts. - -Peak RSS per shape, each in its own process (baseline 4 MiB): +| `point_entity` | `[:p{m} :age ?a]` | 20 µs / 31 µs | 17 µs / 32 µs | 17 µs / 32 µs | +| `attribute_value` | `[?e :name "p{m}"]` (1 row) | 22 µs / 29 µs | 16 µs / 32 µs | 16 µs / 32 µs | +| `attribute_scan` | `[?e :age ?a]` (N/6 rows) | 10.79 ms / 11.38 ms | 116.93 ms / 120.56 ms | 1.18 s / 1.19 s | +| `join_2` | `[:p{m} :follows ?f] [?f :name ?n]` (1 row) | 43 µs / 54 µs | 34 µs / 51 µs | 35 µs / 52 µs | +| `join_3_selective` | `[:p{m} :manager ?b] [?s :manager ?b] [?s :name ?n]` (10 rows) | 207 µs / 238 µs | 190 µs / 230 µs | 181 µs / 228 µs | +| `join_3_scan` | `[?e :follows ?f] [?f :group 7] [?f :name ?n]` | 38.34 ms / 39.53 ms | 1.01 s / 1.02 s | 11.74 s / 11.80 s | +| `join_2_pseudo` | `join_2` with `?f :db/tx-count ?t`, any valid time | 54 µs / 66 µs | 43 µs / 59 µs | 42 µs / 60 µs | +| `not_probe` | `[?e :group 7] (not [?e :age 7])` | 2.68 ms / 3.36 ms | 24.90 ms / 25.49 ms | 260.85 ms / 273.83 ms | +| `not_join_hash` | `not-join [?a]` against group 17, age < 50 | 5.23 ms / 5.87 ms | 47.09 ms / 48.45 ms | 484.72 ms / 501.32 ms | +| `or_2` | `or-join [?a]`: group 17, age < 30; group 27, age > 60 | 7.85 ms / 8.33 ms | 70.18 ms / 71.99 ms | 734.90 ms / 751.49 ms | +| `recursive_ancestors` | `(boss :p{leaf} ?b)` over `:manager` (5–7 rows) | 1.07 ms / 1.37 ms | 1.35 ms / 1.42 ms | 1.81 ms / 1.90 ms | +| `recursive` | `(boss ?x ?b)`, whole transitive closure | 163.59 ms / 171.80 ms | 2.61 s / 2.62 s | 44.76 s / 44.92 s | +| `as_of` | `:as-of {tx}`, `[:p{m/4} :age ?a]` | 21 µs / 30 µs | 17 µs / 32 µs | 18 µs / 33 µs | +| `as_of_ts` | `as_of` with the time of transaction `tx_half` | 708 µs / 906 µs | 824 µs / 871 µs | 979 µs / 1.03 ms | +| `as_of_ts_scan` | `attribute_scan` with the time of transaction `tx_half` | 6.82 ms / 7.69 ms | 67.05 ms / 69.19 ms | 670.83 ms / 688.81 ms | +| `valid_at` | `:valid-at "2021-06-01…"`, `[:p{m} :status ?s]` | 23 µs / 34 µs | 19 µs / 34 µs | 19 µs / 35 µs | +| `limit` | `[:find ?e ?a :where [?e :age ?a] :limit 10]` (#306) | 253 µs / 311 µs | 244 µs / 275 µs | 240 µs / 270 µs | +| `top_k` | `attribute_scan` with `:order-by [?a :desc] :limit 10` | 19.07 ms / 19.89 ms | 207.75 ms / 220.99 ms | 2.14 s / 2.18 s | +| `ordered_values` | `[:find ?a :where [?e :age ?a] :order-by [?a] :limit 10]` | 326 µs / 418 µs | 321 µs / 361 µs | 324 µs / 398 µs | +| `count` | `[:find (count ?v) :where [?e ?a ?v]]` | 37.83 ms / 40.11 ms | 380.83 ms / 394.63 ms | 3.82 s / 3.84 s | +| `count_grouped` | `[:find ?g (count ?e) :where [?e :group ?g]]` | 5.38 ms / 6.12 ms | 53.76 ms / 57.93 ms | 549.54 ms / 572.18 ms | +| `window` | `[:find ?e (rank :over (:order-by ?a)) :where [?e :age ?a]]` | 32.71 ms / 33.86 ms | 424.93 ms / 435.01 ms | 5.50 s / 6.10 s | +| `hot_current` | `[:hot :counter ?v]`, 1,000 versions | 240 µs / 282 µs | 223 µs / 254 µs | 224 µs / 254 µs | +| `hot_as_of` | same, `:as-of` halfway | 239 µs / 288 µs | 218 µs / 242 µs | 217 µs / 246 µs | +| `expr_eq_keyword` | `[:find ?f :where [?f :name ?n] [(= ?f :p5)]]` | 24.09 ms / 27.55 ms | 261.10 ms / 270.60 ms | 2.91 s / 2.94 s | +| `expr_eq_uuid_keyword` | `[:find ?f :where [?f :name ?n] [(= ?f :{uuid-of-p5})]]` | 24.04 ms / 24.80 ms | 258.94 ms / 269.03 ms | 2.92 s / 2.92 s | +| `expr_eq_keyword_reverse` | `[:find ?f :where [?f :name ?n] [(= :p5 ?f)]]` | 24.11 ms / 24.64 ms | 260.77 ms / 274.40 ms | 2.93 s / 2.94 s | +| `expr_eq_uuid_keyword_reverse` | `[:find ?f :where [?f :name ?n] [(= :{uuid-of-p5} ?f)]]` | 24.10 ms / 27.09 ms | 261.33 ms / 270.75 ms | 2.93 s / 2.95 s | +| `expr_neq_keyword` | `[:find ?f :where [?f :name ?n] [(!= ?f :p5)]]` | 24.56 ms / 26.29 ms | 262.96 ms / 271.53 ms | 2.70 s / 2.71 s | +| `expr_neq_uuid_keyword` | `[:find ?f :where [?f :name ?n] [(!= ?f :{uuid-of-p5})]]` | 24.42 ms / 25.65 ms | 262.25 ms / 274.47 ms | 2.71 s / 2.72 s | +| `expr_neq_keyword_reverse` | `[:find ?f :where [?f :name ?n] [(!= :p5 ?f)]]` | 24.46 ms / 27.57 ms | 263.22 ms / 275.52 ms | 2.72 s / 2.73 s | +| `expr_neq_uuid_keyword_reverse` | `[:find ?f :where [?f :name ?n] [(!= :{uuid-of-p5} ?f)]]` | 24.60 ms / 25.51 ms | 262.64 ms / 329.43 ms | 2.71 s / 2.73 s | + +Below 100 timed runs, p99 is the slowest run. Each shape runs in its own process, with up to 200 timed runs, a 15-second budget and a minimum of five runs; the initial run has a 60-second cap. All 96 shape/scale cases completed. At 10M, `recursive`, `window`, `count` and `join_3_scan` each have five timed runs. Peak RSS per shape, including process memory: | Shape | 100K | 1M | 10M | |---|---:|---:|---:| -| point lookups, `:as-of`, `:valid-at`, hot entity | 4 MiB | 4 MiB | 4 MiB | -| `attribute_value` | 22 MiB | 137 MiB | 729 MiB | -| `attribute_scan` | 22 MiB | 169 MiB | 1,665 MiB | -| `count_grouped` | 24 MiB | 198 MiB | 1,783 MiB | -| `join_2` | 33 MiB | 307 MiB | 2,342 MiB | -| `join_3_selective` | 45 MiB | 376 MiB | 2,856 MiB | -| `join_3_scan` | 59 MiB | 456 MiB | 3,610 MiB | -| `recursive_ancestors` | 375 MiB | 3,259 MiB | 4,832 MiB (at abandonment) | +| `point_entity` | 5 MiB | 5 MiB | 6 MiB | +| `attribute_value` | 5 MiB | 5 MiB | 6 MiB | +| `attribute_scan` | 6 MiB | 7 MiB | 7 MiB | +| `join_2` | 5 MiB | 6 MiB | 6 MiB | +| `join_3_selective` | 5 MiB | 5 MiB | 6 MiB | +| `join_3_scan` | 15 MiB | 43 MiB | 56 MiB | +| `join_2_pseudo` | 5 MiB | 6 MiB | 5 MiB | +| `not_probe` | 6 MiB | 7 MiB | 7 MiB | +| `not_join_hash` | 7 MiB | 8 MiB | 10 MiB | +| `or_2` | 7 MiB | 8 MiB | 14 MiB | +| `recursive_ancestors` | 5 MiB | 5 MiB | 5 MiB | +| `recursive` | 43 MiB | 356 MiB | 2539 MiB | +| `as_of` | 5 MiB | 5 MiB | 5 MiB | +| `as_of_ts` | 5 MiB | 5 MiB | 6 MiB | +| `as_of_ts_scan` | 6 MiB | 7 MiB | 7 MiB | +| `valid_at` | 5 MiB | 6 MiB | 5 MiB | +| `limit` | 5 MiB | 5 MiB | 6 MiB | +| `top_k` | 6 MiB | 6 MiB | 7 MiB | +| `ordered_values` | 5 MiB | 6 MiB | 6 MiB | +| `count` | 7 MiB | 7 MiB | 7 MiB | +| `count_grouped` | 6 MiB | 7 MiB | 7 MiB | +| `window` | 16 MiB | 102 MiB | 876 MiB | +| `hot_current` | 5 MiB | 5 MiB | 5 MiB | +| `hot_as_of` | 5 MiB | 6 MiB | 6 MiB | +| `expr_eq_keyword` | 8 MiB | 27 MiB | 173 MiB | +| `expr_eq_uuid_keyword` | 8 MiB | 27 MiB | 173 MiB | +| `expr_eq_keyword_reverse` | 7 MiB | 27 MiB | 172 MiB | +| `expr_eq_uuid_keyword_reverse` | 8 MiB | 27 MiB | 173 MiB | +| `expr_neq_keyword` | 7 MiB | 7 MiB | 7 MiB | +| `expr_neq_uuid_keyword` | 7 MiB | 7 MiB | 7 MiB | +| `expr_neq_keyword_reverse` | 7 MiB | 7 MiB | 7 MiB | +| `expr_neq_uuid_keyword_reverse` | 7 MiB | 7 MiB | 7 MiB | + +### Changes since the previous snapshot + +These are p50 latency changes against the published [#551 snapshot](#executor-removal-551), at the same fact counts; negative means faster. This is a comparison of snapshots, not a controlled A/B attribution. Rows below exceed or straddle 10% at one or more scales. Ranges preserve #551's grouped measurements rather than inventing per-shape baselines. + +| Shape | 100K | 1M | 10M | +|---|---:|---:|---:| +| `point_entity` | -3.8% to +12.3% | -16.0% to -6.7% | -15.1% to -5.7% | +| `as_of` | +2.2% to +19.2% | -13.6% to -3.9% | -11.0% to -1.1% | +| `valid_at` | +7.2% to +25.1% | -7.0% to +3.4% | -7.1% to +3.2% | +| `attribute_value` | +21.1% | -6.3% | -8.4% | +| `join_2` | +11.4% | -7.7% | -7.1% | +| `join_2_pseudo` | +21.7% to +37.4% | +0.1% to +16.4% | -1.2% to +14.8% | +| `hot_current` | -19.9% to -17.1% | -25.7% to -23.2% | -25.3% to -22.7% | +| `hot_as_of` | -20.3% to -17.6% | -27.3% to -24.8% | -27.5% to -25.0% | +| `attribute_scan` | -53.3% | -52.9% | -53.9% | +| `as_of_ts_scan` | -49.1% | -50.7% | -52.1% | +| `not_probe` | -9.8% | -7.8% | -10.4% | +| `not_join_hash` | -11.1% | -11.0% | -14.8% | +| `or_2` | -8.9% | -12.6% | -14.9% | +| `count` | -15.2% | -13.8% | -15.5% | +| `count_grouped` | -9.2% | -11.6% | -9.9% | +| `join_3_scan` | -7.4% | -10.3% | -11.1% | +| `recursive` | -26.6% | -24.2% | -22.0% | + +An interval crossing ±10% leaves that threshold unresolved. `join_3_selective`, `recursive_ancestors`, `as_of_ts` and `window` stay within 10% at every scale. + +The later [#530 comparison](#projected-uuid-lookup-batching-530-unreleased) measured the 1M attribute scan at 135.55 ms after batched DICT reads; it is now 116.93 ms (-13.7%). Its point lookup was 18.23 µs, now 16.80 µs (-7.9%). Its separate sparse/ref/column probes were not rerun here. #530 records a plausible contributor to the scan improvements since #551: batching projected UUID lookups. This run does not isolate that contribution or establish causes for the other changes. + +New to the #551 all-shapes table: `ordered_values`, all eight `expr_*` variants, `limit` and `top_k`. The last two have earlier [#306 measurements](#limit-306): `limit` is now 17.5% / 22.9% / 24.5% faster and `top_k` 14.9% / 13.8% / 15.9% faster at 100K / 1M / 10M. `hot_current` and `hot_as_of` were already measured by #551. The 1M irregular-timestamp fixture was not rerun. + +**Regression review:** no query p50 is demonstrably more than 25% slower than the published #551 ranges; the grouped baselines leave that threshold unresolved for `join_2_pseudo` and `valid_at` at 100K. Against the previous README's #551 figures, opening at 10M rose from 0.13–0.23 ms to 0.409 ms (+78% to +215%). Tail latency also rose: `valid_at` at 10M is 34.66 µs p99 versus the grouped 22–27 µs (+28% to +58%); `point_entity` and `as_of` are 31.90 and 33.22 µs (at least +18% and +23%). Checkpoint p99 at 10M is 3.30 ms versus 2.2–2.9 ms (+14% to +50%). These snapshots do not establish the causes. The storage table also replaces the older 2026-10-11 laptop run; it is not a same-host regression baseline. ### Fixture `N` facts over `N/6` entities `:p{i}`, six facts each: `:name "p{i}"`, `:age i%90`, `:group i%100`, `:follows :p{(7919·i+1) mod E}`, `:manager :p{i/10}` (a tree with fan-out 10), and `:status` in two valid-time windows (`"a"` for 2020–2023, `"b"` from 2023). Plus `:hot :counter`, retracted and reasserted 1,000 times. `m = E/2`. Every query drains its cursor with `next_batch(1000)`. Shapes run in their own process on the fixture opened read-only. The storage rows use a copy. -The harness builds with `--profile envelope`: `release` at opt-level 3, which is how an application's release build compiles the library. `release` and `bench` (which inherits it) are opt-level "z" for the REPL binary's size, and run these queries about 1.5× slower (`attribute_scan` at 1M facts: 703 ms against 462 ms). The Criterion numbers elsewhere in this file are opt-level "z". +The harness builds with `--profile envelope`: `release` at opt-level 3, which is how an application's release build compiles the library. `release` and `bench` (which inherits it) are opt-level "z" for the REPL binary's size, and ran the pre-engine 2026-10-11 `attribute_scan` at 1M facts about 1.5× slower (703 ms against 462 ms). The Criterion numbers elsewhere in this file are opt-level "z". ### Where the time goes (1M facts) @@ -875,7 +948,7 @@ On the executor, before #544 (the executor's query path is gone since #551). `pe ### Streaming engine (#544) -Single-pattern queries run on the streaming engine since #544 (with expressions and pseudo-attributes since its second PR); a cursor pulls one batch of up to 1,024 rows at a time. A/B on an otherwise idle two-socket server, each run pinned to its own NUMA node, base and change on different sockets and swapped between rounds; `v3` before #544 PR 3 (ce2e320) against #544 PR 3, two rounds each, p50 shown (the table above is an older run on a different machine). +Single-pattern queries run on the streaming engine since #544 (with expressions and pseudo-attributes since its second PR); a cursor pulls one batch of up to 1,024 rows at a time. A/B on an otherwise idle two-socket server, each run pinned to its own NUMA node, base and change on different sockets and swapped between rounds; `v3` before #544 PR 3 (ce2e320) against #544 PR 3, two rounds each, p50 shown; these are historical measurements from before the alpha refresh above. | Shape | 100K | 1M | 10M | |---|---:|---:|---:| @@ -884,7 +957,7 @@ Single-pattern queries run on the streaming engine since #544 (with expressions | `attribute_scan` peak RSS, `v3` → PR 3 | 11 → 6 MiB | 58 → 7 MiB | 458 → 7 MiB | | point, `:as-of`, `:valid-at`, hot entity | unchanged (16–26 µs; hot 0.3 ms) | unchanged | unchanged | -`attribute_value` reads only the AVET range of its value since #544 PR 1 (#518): 22–24 µs at every scale here, where the table above, before #544, has 24.5 ms, 288 ms and 3.16 s. An attribute scan drained with `next_batch(1000)` now holds one batch: peak RSS no longer grows with the number of rows (1.67M rows at 10M facts in 7 MiB, against a 4 MiB baseline). Before PR 3 the cursor held the whole answer, and in PR 3's first commit the query's id cache still held every entity it returned (189 MiB at 10M). Aggregates and rules still run on the executor and are unchanged (#546–#548). Joins: see below. +`attribute_value` reads only the AVET range of its value since #544 PR 1 (#518): 22–24 µs at every scale here, against 24.5 ms, 288 ms and 3.16 s in the pre-#544 laptop run of 2026-10-11. An attribute scan drained with `next_batch(1000)` now holds one batch: peak RSS no longer grows with the number of rows (1.67M rows at 10M facts in 7 MiB, against a 4 MiB baseline). Before PR 3 the cursor held the whole answer, and in PR 3's first commit the query's id cache still held every entity it returned (189 MiB at 10M). Aggregates and rules still run on the executor and are unchanged (#546–#548). Joins: see below. ### Joins on the streaming engine (#545) @@ -902,7 +975,7 @@ Queries of several patterns run on the engine since #545 PR 2: an `IndexNestedLo `join_2` probes one entity's range for its one outer row. `join_3_selective` joins on the value position, so it is a `HashJoin` that reads every `:manager` fact into its table: a value probe would need AVET over pending facts, which the pending store does not have (decision 3 of the #545 plan). `join_3_scan` scans the AVET range of `:group 7`, joins `:follows` on its value with a `HashJoin` built on those rows (it streams every `:follows` fact), then probes `:name` per row. -At 10M facts with PR 3 (same server, two rounds; the PR 2 code is unchanged for these shapes, and both builds agree within 2%): `join_2` 51 µs and 4 MiB; `join_3_selective` 2.48–2.52 s and 66 MiB, its `HashJoin` table holding the 10M-fact graph's 1.67M `:manager` facts; `join_3_scan` 13.6 s and 59–63 MiB. The 10M figures in the first table above, before #545 and on the laptop, are 6.50 s, 13.5 s and 20.9 s with 2.3–3.6 GiB of RSS. +At 10M facts with PR 3 (same server, two rounds; the PR 2 code is unchanged for these shapes, and both builds agree within 2%): `join_2` 51 µs and 4 MiB; `join_3_selective` 2.48–2.52 s and 66 MiB, its `HashJoin` table holding the 10M-fact graph's 1.67M `:manager` facts; `join_3_scan` 13.6 s and 59–63 MiB. The pre-#545 laptop run of 2026-10-11 measured 6.50 s, 13.5 s and 20.9 s with 2.3–3.6 GiB of RSS. #### Pseudo-attributes across joins (#545 PR 3) @@ -997,7 +1070,7 @@ A/B on the same idle server (2026-10-24), `v3` before #551 PR 1 (`1096e6a2`, wit | `join_2` | 37.5 → 38.6 µs | 35.7 → 37.3 µs | 36.0 → 36.9 µs | 35.7 → 37.2 µs | | every other shape | within 2%, `not_probe` +4% | within 2% | within 3% | within 2% | -Every shape on PR 3, from the same run (before #726, see the notes; p50 of the two rounds, peak RSS): +Historical #551 snapshot, retained for comparison with the [alpha refresh](#performance-envelope-v300-394). Every shape on PR 3, from the same run (before #726, see the notes; p50 of the two rounds, peak RSS): | Shape | 100K | 1M | 10M | Peak RSS at 10M | |---|---:|---:|---:|---:|