B1.6 · dive — the two renderings
Eleven divisions, fixed positions.
A decimal rendering of a 60-something-bit snowflake performs about 19 divmods by 10 into a variable-width buffer whose length is only known at the end. The branded rendering performs exactly 11 divmods by 62 into fixed positions 3 through 13 of a 14-byte buffer, then copies 3 namespace bytes into positions 0 through 2. Fewer divisions, no width computation, no length to return.
Source: content/bcs1.a1.md · the two renderings, derived. The structure comes first; the five clocks of the next dive test it.
The derivation
content/bcs1.a1.md · the two renderings, derivedThe structure predicts a win for the brand wherever both forms run as compiled userland code — eleven divisions into positions fixed before the first one runs, against nineteen into a width the code must then account for. It leaves a question mark wherever one side gets engine-level help: V8’s decimal conversion is engine C++, while a userland BigInt base62 pays interpreter-level costs per divmod. And it predicts the storage column unconditionally: five fewer bytes per key pushed the embedded object down one allocator size class in Chapter 1.3’s measurement, 65 against 73 on Valkey 8.1’s single-allocation entries.
Nothing in this dive runs a clock. The derivation fixes what the benchmarks are allowed to mean before they exist — where the compiled rows of the next dive confirm it, that is the structure cashing; where the Node row contradicts it, that is the engine-help question mark resolving against the userland side.
The storage column, unconditional
inherited from Chapter 1.3 · bench/valkey-idfmt keylen redis7 valkey81 saved brd14 14 88 65 23 u64dec 19 104 73 31
The rows are Chapter 1.3’s record, inherited verbatim — value an 8-byte
embstr, one million keys per run. The branded 14-byte form costs 65 bytes per key on
Valkey 8.1’s table; its own 19-digit decimal rendering costs 73 — 8 bytes more.
Whatever the clocks return, this column is settled: the same integer, dressed in its own decimal
digits, is the more expensive tenant.
Three accountings
content/bcs1.a1.md · the derivation, itemizedThe ledger is the whole argument in three rows. The denser alphabet retires eight divisions before any clock runs; the fixed layout deletes the width computation; the constant length deletes the return value. What the ledger cannot settle — the engine-help question mark — is the next dive’s subject, where the five committed clocks resolve it runtime by runtime.
References
sources · relatedSources
- Söderqvist — A new hash tablethe single-allocation entries the size-class step rides
- Wikipedia — Snowflake IDthe 60-something-bit integer both renderings encode
Related
- B1.6 — Branding Beats Its Own Integerthe module hub; the appendix in context
- B1.3 — The ID Systemthe storage record — 65 against 73 — this derivation inherits
- B1 — Ideas Behindthe chapter landing; the Part I arc
- BCS — the course homethe law, the id anatomy, the chapter map