Core-set benchmarks 1–9 — results
Benchmarks 1–9 of the core benchmark set, run with benchmarks/core_set.py
on dedicated hosts (4 CPU, 8 GB, Postgres 16, pool of 8 on every arm; measured, recorded in
each run's _env.json and .out). Every run below
records contended: false. Disk is bytes above the empty schema after VACUUM, all tables,
our side tables and indexes included. "Ours / up" is ours divided by upstream on the same graph.
Every run below is measured before public release; their ledgers are not in this repository,
and just bench-case reproduces the benchmarks (benchmarks/README.md). A run is named here by a
short label.
| Run | What it holds |
|---|---|
core12 |
Benchmarks 1 and 2, before the fixes below |
core3 |
Benchmark 3 |
b1-largefix |
Benchmark 1 with the large-base fix |
regr-b2, regr-four, regr-large |
Regression check of the large-base fix on smaller profiles |
core45 |
Benchmarks 4 and 5, with the codec-hop fix and the large-base fix |
core689 |
Benchmarks 6, 8 and 9 |
core7 |
Benchmark 7, with the base-fetch fix |
b33base, b33thr |
Benchmark 9 without and with the 1 KB patch floor |
b30b1def, b30b1c512 |
Benchmark 1 at +10 MB, base cache 64 and 512 MiB |
b30b5def, b30b5c256 |
Benchmark 5, base cache 64 and 256 MiB |
b34b7 |
Benchmark 7 with the cross-namespace estimate |
b35h400, b35h5k |
Benchmark 3 history reads per page at 400 and 5,000 steps (the 5,000-step run stopped before ours on the mixed graph) |
Benchmark 1 — big appends — measured
One value grows by 1 MB, then by 10 MB, per step for 30 steps.
| Graph, step | Upstream | Ours before the fix | Ours with the large-base fix |
|---|---|---|---|
| Plain, +1 MB | 213.7 MB | 129.1 MB (0.60×) | 71.2 MB (0.33×) |
| Plain, +10 MB | 2,131 MB | 1,696 MB (0.80×) | 1,680 MB (0.79×) |
DeltaChannel, +1 MB |
13.3 MB | 13.4 MB | 13.4 MB |
DeltaChannel, +10 MB |
129.5 MB | 129.6 MB | 129.6 MB |
- Before the large-base fix patching stopped once the value passed about 20 MB, and never started at 10 MB per step. The cause: zstd loads only the last 2^24 − 2 bytes of a dictionary at our strategy, so a larger base's head went unmatched (patch-write-path.md).
- With the fix, at +1 MB the thread patches to the end. At +10 MB it patches once (step 6) and then writes full copies: the value passes the 64 MiB base-cache default, so no base is held. Raising the cache is a separate decision (ADR-0032 kept 64 MiB). The section below confirms the cause.
Base cache size at +10 MB — measured
Benchmark 1, plain graph, +10 MB a step for 30 steps, with our base cache at the
64 MiB default and at 512 MiB (--cache-mb), runs b30b1def and b30b1c512:
| Cache | Stored kinds of messages, by step |
Ours disk (MB) | Ours / up | Ours peak RSS growth (MB) |
|---|---|---|---|---|
| 64 MiB | FFFFFPFFFFFFFFFFFFFFFFFFFFFFFF |
1,680 | 0.79× | 2,189 |
| 512 MiB | FFFFFPFPFPPFPFFFFFFFFFFFFFFFFF |
1,555 | 0.73× | 2,602 |
- The cache was the cause through step 13: with 512 MiB, steps 6, 8, 10, 11 and 13 patch
where 64 MiB patched only step 6. The steps between write full copies, which become the next
base (
inferred: two steps of new prose make a patch larger than a quarter of its base's stored size). - From step 14 no cache helps: a patch needs its base and the value inside zstd's 256 MiB window
(
_patch.WINDOW), and a 140 MB value with its 120 MB base no longer fits. Past about 128 MB a value is always a full copy. - The saving is 124 MB of 1,680 MB for 414 MB more peak RSS.
Benchmark 5 (the 60-thread fleet of 1–3 MB values) at 64 and 256 MiB, runs
b30b5def and b30b5c256: disk is equal in every variant (95.1–95.2 MB plain),
and aput p50 moves by less than 0.3 ms. Cache misses fall from 60 a round to 0 after the first
round, but base fetches were already 0: the graph's read holds the base for the put (benchmark 5
above). Peak RSS growth rises by 43 MB with one saver, 101 MB with two savers, 43 MB with branches
and 89 MB with a restart. A larger default buys this fleet nothing and costs memory.
- put timings for benchmark 1 are not quoted: the aput_ms cell median and the per-step
printout disagree, which is a harness defect to fix before benchmark 1 timings are used.
Benchmark 2 — change modes — measured
One growing value under six change modes, run core12. Disk in MB,
put p50 in ms.
| Mode | Plain disk up / ours | Ours / up | Plain put p50 up / ours |
DeltaChannel disk up / ours |
DeltaChannel put p50 up / ours |
|---|---|---|---|---|---|
| Append | 5.25 / 1.99 | 0.38× | 3.16 / 3.12 | 1.32 / 1.45 | 3.17 / 3.19 |
| Summarise then regrow | 1.85 / 1.68 | 0.91× | 2.73 / 2.72 | 1.20 / 1.38 | 3.08 / 3.18 |
| Rewrite | 9.21 / 5.96 | 0.65× | 3.67 / 3.15 | 5.15 / 5.30 | 4.03 / 5.48 |
| Scattered edits | 6.55 / 3.10 | 0.47× | 2.77 / 2.64 | 2.17 / 2.20 | 2.99 / 3.59 |
| A/B oscillation | 3.60 / 2.55 | 0.71× | 2.70 / 2.45 | 2.33 / 2.51 | 3.05 / 3.64 |
| Encrypting serde | 12.84 / 12.80 | 1.00× | 5.31 / 4.25 | 1.45 / 1.48 | 5.57 / 4.80 |
- Plain graph: ours is smaller in every mode except the encrypting serde, where ciphertext leaves nothing to patch and ours matches upstream.
DeltaChannelgraph: ours read 1.02–1.15× upstream on disk. That excess is free space in half-empty heap pages, not data: in theregr-b2re-run, which records used bytes (used_bytes_above_empty_schema), ours is 0.99–1.02× upstream in every mode.DeltaChannelputp50 was slower in rewrite, scattered and oscillate incore12. The codec-hop fix removed two codec-thread hops on puts with nothing to store. In theregr-b2re-run the three modes read 4.43 vs 4.15, 3.49 vs 4.22 and 4.14 vs 3.35 ms (ours vs up), so the gap now moves in both directions between runs; it is within run-to-run spread (inferredfrom two runs; repetitions would confirm).
Benchmark 3 — long thread — measured
5,000 small appends, disk at every 500 steps, run core3. Disk in MB.
| Steps | 500 | 1,000 | 2,000 | 3,000 | 4,000 | 5,000 |
|---|---|---|---|---|---|---|
| Plain, upstream | 21.0 | 76.8 | 294 | 653 | 1,152 | 1,792 |
| Plain, ours | 5.1 | 12.6 | 36.4 | 71.1 | 119 | 177 |
| Plain, up / ours | 4.2× | 6.1× | 8.1× | 9.2× | 9.7× | 10.1× |
DeltaChannel, upstream |
3.0 | 6.1 | 13.3 | 22.0 | 32.0 | 43.5 |
DeltaChannel, ours |
3.0 | 5.7 | 11.1 | 16.8 | 22.7 | 28.5 |
| Mixed, upstream | 21.8 | 78.8 | 300 | 663 | 1,168 | 1,816 |
| Mixed, ours | 5.9 | 14.4 | 40.0 | 76.9 | 127 | 188 |
- Growth is still quadratic in steps on the plain and mixed graphs for both savers. Ours has
a constant about 10× smaller, so the lead widens with thread length (
inferredfrom the curve's shape). - On the
DeltaChannelgraph ours ends at 0.65× upstream. Most of the difference ischeckpoint_blobs(4.9 MB vs 19.4 MB at 5,000 steps): upstream's channel snapshots are stored whole, ours as patches.
Latency at 5,000 steps, ms, p50 / p95:
| Graph | aput up |
aput ours |
aget_tuple up |
aget_tuple ours |
|---|---|---|---|---|
| Plain | 5.73 / 69.9 | 6.51 / 36.9 | 60.4 / 114 | 53.0 / 104 |
DeltaChannel |
2.99 / 6.53 | 1.60 / 7.30 | 64.0 / 137 | 52.6 / 97.6 |
| Mixed | 9.43 / 72.8 | 9.20 / 35.6 | 146 / 214 | 108 / 180 |
- At 5,000 steps our plain-graph
aputp50 is 0.78 ms slower than upstream's while its p95 is about half; the other p50s are level or ours is faster.
Whole-thread reads (15,000 checkpoints, three per step), paged by 100, seconds:
| Graph | alist up / ours |
aget_state_history up / ours |
|---|---|---|
| Plain | 586 / 503 | 594 / 509 |
DeltaChannel |
32.3 / 17.8 | 1,534 / 1,518 |
| Mixed | 610 / 515 | 2,114 / 2,004 |
aget_state_historyon aDeltaChannelthread costs about 25 minutes on both savers; the saver is not where that time goes (inferred: equal on both arms, whilealiston the same thread takes 18–32 s). These runs predate the depth-bounded history walk that came with the codec-hop fix.
aget_state_history per page — measured
Benchmark 3 again, with the depth-bounded history walk, on 400 and 5,000 steps (1,200 and 15,000 checkpoints),
pages of 100, runs b35h400 and b35h5k. The 5,000-step run was stopped
after its plain and DeltaChannel arms, before ours on the mixed graph, when it hit its time limit. That run therefore recorded
cells.jsonl only, with no .out; every record reads contended: false.
| Read, graph, steps | Whole thread up / ours (s) | Page p50 up / ours (s) | Page p95 up / ours (s) | Client CPU ours (s) | Peak RSS growth ours (MB) |
|---|---|---|---|---|---|
aget_state_history, DeltaChannel, 400 |
13.7 / 13.4 | 0.88 / 0.96 | 2.10 / 2.09 | 8.9 | 68 |
aget_state_history, DeltaChannel, 5,000 |
1,573 / 1,616 | 9.13 / 9.46 | 23.3 / 24.8 | 1,504 | 1,590 |
alist, DeltaChannel, 5,000 |
32.4 / 18.1 | 0.20 / 0.11 | 0.33 / 0.21 | 5.3 | 15 |
aget_state_history, plain, 5,000 |
571 / 501 | 3.75 / 3.30 | 6.91 / 6.48 | 493 | 1,416 |
- History of a long
DeltaChannelthread costs 26–27 minutes and 1.6 GB on both savers. The client is busy for nearly all of it (1,504 s of CPU in 1,616 s), so the cost is LangGraph replaying each checkpoint's channel, not the saver.alistover the same thread takes 18 s. - It grows about with the square of the thread (
inferredfrom two lengths): 12.5 times the checkpoints take 115–120 times as long, and a page near the end costs ten times a page at 400 steps.alistgrows 20 times. - A read that walks the parent chain once and emits each version of one channel would cost about
what
alistcosts (inferred: it reads the same rows once). This is the proposal for feature 13 in thread-listing.md §8.3.
Regression check of the large-base fix on smaller profiles — measured
The large-base fix replaced base-sized match tables with fixed 2^17 tables and passes the base as a prefix.
Against the earlier patch-storage acceptance runs, all measured:
| Profile | Stage 3 acceptance | With the fix |
|---|---|---|
400-step chat, plain: disk ours / up, put p50 |
0.143×, 4.99 ms | 0.143×, 5.01 ms |
400-step chat, DeltaChannel: disk ours / up, put p50 |
0.904×, 1.10 ms | 0.915×, 0.94 ms |
| 1 / 3 / 10 MB threads, plain: our disk | 2.38 / 11.79 / 68.19 MB | 2.39 / 11.98 / 68.47 MB |
1 / 3 / 10 MB threads, plain: our put p50 |
7.05 / 13.0 / 26.0 ms | 7.71 / 10.7 / 14.9 ms |
Benchmark 2's change modes moved by about 1% on disk (regr-b2 against core12). An
interleaved micro-benchmark of make_patch (a 300 B append, 40 alternating calls per size, on
the same host) put the new codec at 0.73×, 0.58×, 0.29× and 0.14× of the old one's time on
0.1, 1, 3 and 10 MB bases, and 0.02 ms slower on a 20 KB base, with patches 4–192 B larger. That
probe was not recorded, so it is inferred support for the cells above, not a quotable result.
Benchmark 4 — deep DeltaChannel history — measured
700 steps of about 300 B (about 2,100 checkpoints), run core45. A new
saver with nothing cached reads old checkpoints by id; every read is checked against the value
written there, and all passed on every arm. delta snapshots every 100 updates (the default),
snap5 every 5, snap1000 never within the thread.
| Graph | Disk up / ours (MB) | Ours / up |
|---|---|---|
| Plain | 39.1 / 7.9 | 0.20× |
DeltaChannel, snapshots every 100 |
4.19 / 4.01 | 0.96× |
DeltaChannel, every 5 |
11.0 / 4.97 | 0.45× |
DeltaChannel, every 1,000 |
3.70 / 3.74 | 1.01× |
aget_state p50 in ms, up / ours:
| Read | Plain | Every 100 | Every 5 | Every 1,000 |
|---|---|---|---|---|
| Head | 8.49 / 9.27 | 8.61 / 8.74 | 9.18 / 10.35 | 148.9 / 170.2 |
| 100 behind | 8.83 / 8.01 | 34.7 / 35.0 | 13.4 / 11.3 | 132.6 / 152.2 |
| 1,000 behind | 5.34 / 4.91 | 21.7 / 20.5 | 10.2 / 7.48 | 59.4 / 58.0 |
| 1,100 behind | 4.85 / 4.72 | 14.5 / 14.6 | 10.1 / 7.50 | 42.5 / 50.7 |
| Just before a snapshot | — | 27.6 / 30.1 | 10.2 / 6.12 | — |
| 20 random checkpoints | 4.99 / 5.70 | 26.4 / 19.0 | 13.0 / 6.66 | 70.0 / 67.8 |
| Head of a fork from the oldest step | 1.07 / 1.08 | 13.7 / 2.17 | 14.7 / 2.11 | 13.9 / 1.98 |
- Time travel past 1,024 checkpoints is correct on both savers.
- A read costs what the walk back to the last snapshot costs. With no snapshot in reach
(
snap1000), a head read takes about 150 ms on upstream, and ours is about 15% slower at the head, 100 and 500 behind (148.9 / 170.2, 132.6 / 152.2, 95.3 / 109.3 ms) and level from 1,000 behind. Where snapshots are frequent, ours is faster at depth and at random positions. The cause of the 15% is not known (inferred: our walk and upstream's return the same writes, so the difference is in how they are fetched or decoded; a profile of one read would show it). - A fork's head reads 6–7× faster on ours on every
DeltaChannelspacing.
Benchmark 5 — large-thread fleet — measured
60 threads whose first message is 1, 2 or 3 MB, written round-robin for 6 rounds (360 steps), each
variant in its own database, run core45. Every thread's final value
was checked, on both branches in the branches variant.
| Variant | Plain disk up / ours (MB) | Plain aput per step p50 / p95, up |
ours | Ours peak RSS growth / up's (MB) |
|---|---|---|---|---|
| One saver | 416.4 / 95.4 | 68.6 / 110 ms | 10.4 / 16.7 ms | 147 / 78 |
| Two savers, no affinity | 416.5 / 95.5 | 68.5 / 109 ms | 10.2 / 16.7 ms | 235 / 98 |
| Two branches through one saver | 416.5 / 95.3 | 68.9 / 105 ms | 10.4 / 18.3 ms | 142 / 86 |
| Fleet restart halfway | 416.5 / 95.5 | 68.7 / 106 ms | 10.6 / 16.8 ms | 209 / 73 |
- The cache misses but costs no round trip. 60 threads of 1–3 MB do not fit in a 64 MiB base cache, so ours missed on all 360 steps of every plain variant, yet fetched a base 0 times: each graph step reads the thread first, and the read leaves the base in the cache. After the restart, ours ran at 11.6 ms a step against upstream's 69.5 ms.
- Ours holds more memory: 1.6–2.9× upstream's RSS growth, and more with two savers or after a
restart. The base cache, up to 64 MiB per saver, accounts for most of it (
inferred: the two-saver and restart variants add about one cache each). - Ours uses more client CPU per step on the plain graph (p50 16.9–24.5 ms against 11.9–16.4 ms), the cost of encoding patches.
DeltaChannelgraph: disk is equal (54.1 MB on both), and oursaputper step is 4.3 ms against 6.4 ms.
Benchmark 6 — elephant and mice — measured
100 threads of 10 steps of about 100 B, all at once on one saver (pool of 8), run
core689. The elephant variant adds one thread whose first message is 50 MB,
then two tiny appends; the burst variant runs 1,000 one-step threads at once. Every thread's
value was checked.
| Variant, graph | Wall up / ours (s) | Mouse step p50 / p95, up (ms) | ours (ms) |
|---|---|---|---|
| Mice, plain | 7.47 / 3.39 | 683 / 980 | 328 / 417 |
Mice, DeltaChannel |
8.30 / 3.54 | 826 / 1,045 | 353 / 429 |
| Elephant, plain: mouse steps during its puts | 15.0 / 5.10 | 2,517 / 2,968 | 602 / 764 |
Elephant, DeltaChannel: during its puts |
9.90 / 4.19 | 1,092 / 2,147 | 387 / 664 |
| Burst of 1,000, plain | 7.67 / 3.29 | 6,962 / 7,484 | 3,072 / 3,161 |
Burst of 1,000, DeltaChannel |
6.58 / 3.30 | 6,028 / 6,454 | 3,120 / 3,183 |
- Upstream's saver-wide lock is nearly all of its put time. With the mice alone, upstream's
aputp50 is 185 ms, of which 184 ms is the wait for the lock; ours, with no lock, puts at 59 ms and finishes the same work 2.0–2.3× sooner, in the burst too. - The 50 MB put stalls upstream's other threads more than ours. While the elephant writes, upstream's mouse steps reach p95 2,968 ms (3.0× their p95 without it); ours reach 764 ms (1.8×). Our single codec thread does delay the mice, but less than upstream's lock does. The elephant's own three steps took 3.72, 3.00 and 2.71 s on upstream and 1.97, 0.67 and 0.75 s on ours.
- Ours is bound by client CPU here (
inferred: 3.59 s of client CPU in 3.39 s of wall with the mice alone), so more connections would not help it; one process runs the graph and the codec. - Disk and memory with the elephant, plain graph: 92.2 MB on upstream, 43.9 MB on ours; peak RSS growth 400 MB on upstream, 478 MB on ours.
Benchmark 7 — supervisor — measured
20 steps; each calls a subgraph that shares messages and appends one tiny message, then fans out
with Send to 50 workers that each append a 10 KB message (a 10 MB conversation at the end),
run core7. The first run, before the base-fetch fix, failed on ours: aput raised
ValueError from zstd when a fetched base was under 8 bytes (the tasks channel's empty list).
The base-fetch fix handles that case, and this run includes it. The final value was checked on every arm.
| Graph | Disk up / ours (MB) | checkpoint_blobs |
checkpoint_writes |
aput p50 (ms) |
aget_state p50 (ms) |
|---|---|---|---|---|---|
| Plain | 300.1 / 169.8 (0.57×) | 211.4 / 81.1 | 89.4 / 89.3 | 143.8 / 25.2 | 89.3 / 31.4 |
DeltaChannel |
130.3 / 120.4 (0.92×) | 41.6 / 31.8 | 89.4 / 89.3 | 3.40 / 2.75 | 645.6 / 636.6 |
- Pending writes are the same 89 MB on every arm, uncompressed by both savers at this
commit (a later change compresses ours; see below): on the
DeltaChannelgraph they are 69–74% of the disk. The workers' results and the subgraph's returned list land there before any channel stores them. - A subgraph's namespace does get patches within a call: each call stores its first
messagesvalue as a full copy (19 of them) and the next as a patch against it (19). It also stores the call's input, the whole conversation, as a full copy every call (19,__start__in the subgraph), since a run's input is never patched. So each call costs about two compressed copies of the conversation, where the root namespace patches. - Reads on the
DeltaChannelgraph cost about 640 ms on both savers, replaying a thousand 10 KB writes; on the plain graph ours reads in 31 ms against 89 ms. - Peak RSS growth, up / ours: 266 / 315 MB plain, 623 / 472 MB
DeltaChannel.
A cross-namespace base — measured, saving inferred
Benchmark 7 again, run b34b7 (its arms match the table above
within 1%). After the plain run the harness takes every saver-compressed full copy in a subgraph
namespace (messages and __start__) and patches it with the saver's codec against the root
namespace's latest full copy of messages before that call, keeping a patch only by encode's
own rule (at most a quarter of the base's stored size).
- The subgraph's 38 full copies take 60.8 MB of ours' 81.1 MB
checkpoint_blobs. Against the root's copy all 38 would be kept as patches, totalling 4.65 MB. - So cross-namespace bases would take this graph from 169.9 MB to about 114 MB, 0.38× upstream
instead of 0.57× (
inferred: the patch bytes are measured; the side rows and TOAST overhead of 38 more patches are not counted). - On the
DeltaChannelgraph there is nothing to patch against: the root namespace stores nomessagescopy (the value lives in writes), and the subgraph's__start__copies (19) are most of ours' 31.8 MBcheckpoint_blobs. - Building it is a storage change, not a tweak (
inferredfrom the schema):opc_blob_patchkeys a base by the patch's own namespace and channel, so a cross-namespace base needs two more columns, a new foreign key and index, and a migration. Reads of a subgraph checkpoint then fetch a row from the root namespace.apruneandadelete_for_runs, which choose rows per(thread_id, checkpoint_ns), must keep a root full copy that a subgraph patch still names.rehydratemust resolve the base across namespaces. Every rule keyed on(thread_id, checkpoint_ns)(thescope-by-thread-and-namespacewiki concept) gets an exception.
Compressed pending writes — measured, bytes only
Pending writes of 256 B and up are stored under the full copy's tag (opc:zstd:) when that is
smaller, from the change that added it; a run of benchmarks 2 and 7 on a dedicated
host. The harness marked that run contended (load per core peak 1.185), so its timings are
not quoted; its byte cells are unaffected. Before is our arm in regr-b2 and
core7. Used bytes, ours:
| Workload | checkpoint_writes before / after |
All tables after / upstream |
|---|---|---|
| 7, plain | 89.3 / 69.8 MB | 149.7 / 300.1 MB (0.50×) |
7, DeltaChannel |
89.3 / 69.8 MB | 100.3 / 130.3 MB (0.77×) |
2, DeltaChannel rewrite |
4.28 / 3.69 MB | 4.48 / 4.98 MB (0.90×) |
2, DeltaChannel oscillate |
1.46 / 1.23 MB | 1.98 / 1.98 MB (1.00×) |
2, DeltaChannel scattered |
1.25 / 1.12 MB | 1.92 / 1.97 MB (0.97×) |
2, DeltaChannel append |
0.39 / 0.35 MB | 1.27 / 1.22 MB (1.04×) |
2, DeltaChannel summarise |
0.39 / 0.37 MB | 1.18 / 1.13 MB (1.04×) |
- Writes shrink 4–22%, most where the writes are large: benchmark 7's 10 KB worker results.
- Every
DeltaChannelworkload is within the 1.05× disk bar. The small ones sit near it because our tables' fixed pages (head rows, the ledger, the switch) are a large share of 1 MB. - Our arm's total grew on the small benchmark 2 workloads although its writes shrank: the
earlier run predates the head rows (stage 5) and the listing index (stage 6), so only the
writes column compares across the two runs (
inferred).
Benchmark 8 — retention under writes — measured
300 steps of one 1 KB message, run core689. prune-each runs
aprune(keep_latest) after every step; keep-last-3 runs ours with keep_last=3 (upstream has no
keep_last); racing runs a prune loop while the writer writes (about 600 prunes). Disk in MB,
up / ours, with the checkpoints left:
| Variant | Plain | DeltaChannel |
|---|---|---|
| Never pruned | 22.0 / 4.24 (900 / 900) | 2.12 / 2.06 (900 / 900) |
| Pruned after each run | 0.67 / 0.64 (1 / 1) | 2.12, refused / 0.48 (900 / 1) |
keep_last=3, ours only |
— / 0.74 (3) | — / 1.06 (299) |
| A prune loop racing the writer | 0.65 / 0.74 (1 / 1) | 2.12, refused / 0.48 (900 / 1) |
- Upstream cannot prune a
DeltaChannelthread at all: every call raisedNotImplementedError("keep_latest can't prune threads that use a DeltaChannel"), so the thread kept all 900 checkpoints. Ours pruned it to one checkpoint and 0.48 MB. - Keeping only the tip costs ours nothing measurable when pruning after each run (0.64 MB against 0.67 MB): the base the tip's patch needs stays, but it is no larger than upstream's one full copy. With the racing loop ours ends at 0.74 MB against 0.65 MB; the cause is not known.
keep_last=3on aDeltaChannelthread keeps 299 checkpoints, not 3: a kept checkpoint keeps the history back to its channel's last snapshot (every 100 updates by default), asaprunedocuments.- The race raised no error in about 600 prunes on either saver. The foreign-key failure that
aprunedocuments for a prune racing a writer did not occur here; it needs a writer committing a patch against the very full copy being deleted, which a single growing thread with one base rarely produces (inferred). aprunep50 after each step: 7.05 ms upstream, 4.37 ms ours (plain).
Benchmark 9 — small-value floor — measured
400 steps, run core689; plain graph only except tiny-append (a replaced
dict has no deltas to keep). Values are {"text": ...} dicts: a str, like every primitive, stays
inline in the checkpoint row on both savers (aio.py aput, as upstream) and is never patched.
Checkpoint rows and writes take the same space on both savers (1.3–4.1 MB and 0.5–12.6 MB per run)
and dominate the totals, so the value storage below is the comparison: checkpoint_blobs, plus ours'
opc_blob_patch side table less its empty size (24,576 B), in KB.
| Variant | Up | Ours | Ours / up | Total disk, ours / up | aget_tuple p50 up / ours (ms) |
|---|---|---|---|---|---|
tiny-append (+100 B a step), plain |
5,344 | 1,088 | 0.20× | 0.39× | 4.79 / 5.52 |
scratch200 (below the threshold) |
384 | 384 | 1.00× | 1.00× | 1.16 / 1.69 |
scratch256 |
384 | 496 | 1.29× | 1.04× | 1.82 / 1.88 |
edge (255 and 256 B in turn) |
384 | 480 | 1.25× | 1.01× | 2.00 / 4.99 |
scratch512 |
512 | 592 | 1.16× | 0.98× | 1.51 / 2.04 |
scratch1024 |
736 | 544 | 0.74× | 0.92× | 1.36 / 3.93 |
scratch2048 |
832 | 584 | 0.70× | 0.89× | 1.47 / 4.95 |
wide200 (64 B each, below the threshold) |
2,680 | 2,680 | 1.00× | 1.00× | 4.20 / 5.16 |
wide50 (50 × 300 B, all change) |
12,048 | 12,848 | 1.07× | 1.04× | 2.36 / 9.36 |
- Between 256 and 512 B, the side row costs more than the patch saves: value storage is 1.16–1.29× upstream's (1.07× with 50 channels of 300 B). The crossover lies between 512 B and 1 KB; at 1–2 KB ours stores 0.70–0.74× of upstream's.
- The total stays within 4%, because checkpoint rows and writes dominate a thread of small values.
- Reads of patched small values are slower:
aget_tuplep50 is 2.9–3.4× upstream's at 1–2 KB, and 4.0× with 50 patched channels (9.36 against 2.36 ms): each read decodes a patch per channel. aputis faster on ours in every variant (p50 1.1–2.9 ms against 2.0–6.1 ms).- A patching threshold of about 1 KB, separate from the 256 B compression threshold, would avoid both costs. The run below confirms it.
A 1 KB patch floor — measured
Benchmark 9 again, runs b33base (256 B for both thresholds, as above) and
b33thr (MIN_PATCH_BYTES = 1024: values under 1 KB are compressed full
copies, and the saver fetches no base for them). Same harness, same host spec, one run each,
both contended: false. Value storage in KB as above, ours / up in brackets:
| Variant | Up | Ours, 256 B | Ours, 1 KB floor | aget_tuple p50 ours, 256 B / 1 KB (ms) |
|---|---|---|---|---|
scratch256 |
392 | 512 (1.31×) | 392 (1.02×) | 1.98 / 1.57 |
edge |
384 | 448 (1.17×) | 392 (1.02×) | 1.77 / 1.72 |
scratch512 |
488 | 504 (1.03×) | 432 (0.89×) | 1.69 / 1.57 |
wide50 (50 × 300 B) |
12,048 | 12,856 (1.07×) | 9,504 (0.79×) | 10.06 / 3.50 |
scratch1024, scratch2048 |
736, 832 | 536, 568 | 528, 568 | unchanged kinds |
tiny-append, scratch200, wide200 |
unchanged | unchanged kinds |
- Below 1 KB, a compressed full copy is smaller than a patch with its side row: every variant under the floor now stores 0.79–1.02× upstream's value bytes, against 1.03–1.31× with patches.
- Reads of 50 small channels get 2.9× faster (
aget_tuplep50 10.06 to 3.50 ms;aget_state8.23 to 3.14 ms): a read no longer decodes a patch per channel. - Values of 1 KB and up store the same kinds as before (
scratch1024,scratch2048,tiny-append's growing list). - Other
aget_tuplep50s differ by less than 1 ms in either direction between the two runs; with one run each, those differences are not attributed to the floor.