B1.3 · dive 2 of 4 — seven shapes, one million keys
Seven shapes, four findings.
Redis against Valkey, both jemalloc 5.3.0, one million keys per
shape, a constant 8-byte value, used_memory delta per key after settle. Seven key
shapes enter; four findings come out.
The rows below are the committed output, character for character. The comparator computes deltas live from the same fixed dataset and nothing else.
brd14, and that gap projected per hundred million keys — the arithmetic that yields the
chapter's own 3.2 GB for uuid36.The protocol
content/bcs1.3.md · Measured · BoundariesOne million keys per shape, written to each engine; the used_memory delta
divided by the key count after settle. Both engines on jemalloc 5.3.0, so the allocator's size classes
are held constant and the table is the variable; the constant 8-byte value keeps the value's cost
identical across rows. The deltas include table and allocator effects by design — per-object accounting
differs across the engines and was deliberately not the metric.
The table
bench/valkey-id/valkey_id_bench.out# engines: v=7.0.15 jemalloc-5.3.0 | v=8.1.8 jemalloc-5.3.0 | N=1,000,000/run | value=8B embstr fmt keylen redis7 valkey81 saved brd14 14 88 65 23 u64dec 19 104 73 31 uuid36 36 120 97 23 uuid16 16 104 65 39 ulid26 26 104 81 23 emq26 26 104 81 23 brd14+ttl 14 128 99 29
The publication's claims reproduce on this project's own keys — 23 to 39 bytes saved, 29 on the TTL row — and the ID findings sit inside the columns.
The four findings
content/bcs1.3.md · Measured1 — The branded form ties raw binary: 65 bytes against binary UUID-16's 65, while staying printable, typed, and ordered; the storage argument for binary keys is gone.
2 — Branding beats its own integer: the same snowflake as 19 decimal digits costs 73 — the namespace plus the denser alphabet is a discount, not a tax. Decimal renderings are banned from keys (INV-K1 in the chapter's spec of record).
3 — Canonical UUID strings pay two classes: 97 against 65, 32 bytes a key, 3.2 GB per hundred million keys before replication.
4 — The envelope costs one step: the realistic 26-byte emq:{q}:job:
key lands at 81, even with ULID's 26 characters — at this layer length is destiny and charset is free,
so the prefix budget is a design surface (INV-K2).
UUIDv4 and v7 are storage-identical — the column difference is order, not bytes. The class edges are jemalloc-5.3.0's and move with the malloc; nothing here measures cluster mode.
References
sources · relatedSources
- Söderqvist — A new hash tablethe table under the measured columns
- Valkey 8.1.0 GAthe release whose headline the saved column reproduces
Related
- B1.3 — the module hubthe chooser, settled by measurement
- B1 — Ideas Behindthe chapter landing
- BCS — the course homethe law, the id anatomy, the chapter map
- EchoMQ — the coursethe owner of the emq:{q}:job: envelope grammar
- Redis Patterns Appliedthe substrate patterns these keys feed