cost: measure what durability costs a write #166

Merged
PerishFire merged 1 commit from land/cost/durable into main 2026-08-19 07:46:10 +00:00
Owner

The write benchmarks all run against an in-memory store, so they measure engine
work and nothing else. What is left of the write cost after spare is
persistence, and persistence is exactly what an in-memory store cannot show —
the numbers that decided the last round came from a consumer's server-side
probe, not from here.

This adds a durable round: the same put loop against a file-backed store, and
the same loop again inside one batch. Three numbers fall out of that, and the
third is the one worth having, because a batch is a single transaction and
therefore a single flush.

100 rows  memory 0.44ms  durable 5.83ms  batched 0.38ms  durability 5.44ms
400 rows  memory 0.43ms  durable 5.98ms  batched 0.36ms  durability 5.62ms

Durability is 93% of what a write costs on disk, it does not move with the
number of rows, and one transaction per write is what buys it. That bounds what
group commit could return: about five and a half milliseconds a write, no more,
and only for writes that are in flight together.

The reading agrees with the consumer that raised the question. A 452-reference
push measured 2.4 seconds of flush and roughly 0.3 seconds of engine work there;
this bench predicts 2.49 and 0.20 for the same shape. Two instruments that were
built separately now say the same thing, which is the point of having the second
one.

Ignored like its neighbours: the guard stays fast and the numbers are asked for
when someone is deciding something.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

The write benchmarks all run against an in-memory store, so they measure engine work and nothing else. What is left of the write cost after `spare` is persistence, and persistence is exactly what an in-memory store cannot show — the numbers that decided the last round came from a consumer's server-side probe, not from here. This adds a durable round: the same put loop against a file-backed store, and the same loop again inside one batch. Three numbers fall out of that, and the third is the one worth having, because a batch is a single transaction and therefore a single flush. 100 rows memory 0.44ms durable 5.83ms batched 0.38ms durability 5.44ms 400 rows memory 0.43ms durable 5.98ms batched 0.36ms durability 5.62ms Durability is 93% of what a write costs on disk, it does not move with the number of rows, and one transaction per write is what buys it. That bounds what group commit could return: about five and a half milliseconds a write, no more, and only for writes that are in flight together. The reading agrees with the consumer that raised the question. A 452-reference push measured 2.4 seconds of flush and roughly 0.3 seconds of engine work there; this bench predicts 2.49 and 0.20 for the same shape. Two instruments that were built separately now say the same thing, which is the point of having the second one. Ignored like its neighbours: the guard stays fast and the numbers are asked for when someone is deciding something. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cost: measure what durability costs a write
All checks were successful
guard / guard (pull_request) Successful in 2m4s
guard / guard (push) Successful in 1m55s
9aa2f35dd5
The write benchmarks all run against an in-memory store, so they measure engine
work and nothing else. What is left of the write cost after `spare` is
persistence, and persistence is exactly what an in-memory store cannot show —
the numbers that decided the last round came from a consumer's server-side
probe, not from here.

This adds a durable round: the same put loop against a file-backed store, and
the same loop again inside one batch. Three numbers fall out of that, and the
third is the one worth having, because a batch is a single transaction and
therefore a single flush.

    100 rows  memory 0.44ms  durable 5.83ms  batched 0.38ms  durability 5.44ms
    400 rows  memory 0.43ms  durable 5.98ms  batched 0.36ms  durability 5.62ms

Durability is 93% of what a write costs on disk, it does not move with the
number of rows, and one transaction per write is what buys it. That bounds what
group commit could return: about five and a half milliseconds a write, no more,
and only for writes that are in flight together.

The reading agrees with the consumer that raised the question. A 452-reference
push measured 2.4 seconds of flush and roughly 0.3 seconds of engine work there;
this bench predicts 2.49 and 0.20 for the same shape. Two instruments that were
built separately now say the same thing, which is the point of having the second
one.

Ignored like its neighbours: the guard stays fast and the numbers are asked for
when someone is deciding something.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Land-Source: cost/durable@bb0e3a7c46
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PerishLab/keel!166
No description provided.