You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: measure benchmarks by fastest run rather than loaded average
The published figures were means taken while the host was busy, which inflated
every engine by an amount that differed between them — so pagedb was reported
as 5.8 us on a range scan that costs 3.6, and 1.1 us on a point read that costs
931 ns. Being wrong in the pessimistic direction is still being wrong.
Contention only ever adds time, so the fastest observed run is the closest
estimate of what the code costs. Repeating the read benches five times in
isolation reproduces pagedb's point read at 931 ns every time, with redb
landing on its own best-known figure, which is what makes the two comparable.
Read and write groups are measured separately: run together, the bulk loads
leave the machine hot and the reads that follow inherit it.
Point reads come out level with redb and RocksDB rather than behind, range
scans ~2x behind redb rather than ~3x, and AEAD read overhead lands at 1.00x.
State the method in the README. A reader comparing these against numbers from
a quiet machine should know which one they are looking at.
| Raw AES-GCM only (memory) |306.5 µs | baseline: encryption cost alone |
193
-
|**pagedb `append_seal`**|**632.7 µs**| full path: write, seal, fsync, link |
194
-
| Raw `tokio::fs` write + AES-GCM | 1.52 ms | what you'd write yourself, badly |
196
+
| Raw AES-GCM only (memory) |300.7 µs | baseline: encryption cost alone |
197
+
|**pagedb `append_seal`**|**560.1 µs**| full path: write, seal, fsync, link |
198
+
| Raw `tokio::fs` write + AES-GCM | 1.40 ms | what you'd write yourself, badly |
195
199
196
-
pagedb's segment writer adds **~2.06× over raw AEAD** but is **2.4× faster than a hand-rolled `fs::write` + AES-GCM** baseline — because pagedb batches, vectorizes, and uses the platform's best async primitive.
200
+
pagedb's segment writer adds **~1.86× over raw AEAD** but is **2.5× faster than a hand-rolled `fs::write` + AES-GCM** baseline — because pagedb batches, vectorizes, and uses the platform's best async primitive.
197
201
198
202
### Read-path decomposition
199
203
200
-
| Step |mean|
204
+
| Step |time|
201
205
| --------------------------------- | -----: |
202
-
|`begin_read` + drop | 157 ns |
203
-
| Warm `get` (transaction reused) | 457 ns |
204
-
| Warm `get` (one transaction each) | 707 ns |
205
-
| Cold authenticated node read | 7.0 µs |
206
-
| Dense repack (compaction) | 314 µs |
206
+
|`begin_read` + drop | 141 ns |
207
+
| Warm `get` (transaction reused) | 369 ns |
208
+
| Warm `get` (one transaction each) | 434 ns |
209
+
| Cold authenticated node read | 6.8 µs |
210
+
| Dense repack (compaction) | 306 µs |
211
+
212
+
A warm `get` allocates nothing: the value is a slice of the cached page, not a
0 commit comments