jonnify·bcs /bcs/ideas/id-system/the-measured-table

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.

The comparator. Bytes per key on Valkey, over jemalloc's 16-byte class lines. Select a shape; the readout prints its row and computes the gap to brd14.
64 80 96 112 65 brd14 73 u64dec 97 uuid36 65 uuid16 81 ulid26 81 emq26 99 brd14+ttl
readout · The fixed dataset is the seven measured rows. Select a shape; the readout prints its verbatim row, the gap to brd14, and that gap projected per hundred million keys — the arithmetic that yields the chapter's own 3.2 GB for uuid36.
§1

The protocol

content/bcs1.3.md · Measured · Boundaries

One 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.

§2

The table

bench/valkey-id/valkey_id_bench.out
content/echo_data/bench/valkey-id/valkey_id_bench.out · verbatimfrozen
# 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.

§3

The four findings

content/bcs1.3.md · Measured

1 — 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).

finding · Select a finding; the readout pairs the rows it rests on and restates the verdict with the measured numbers.

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.

§4

References

sources · related

Sources

Related