B1.6 · dive — the whole-system accounting
Minted once, cheaper forever.
An id is rendered once and then stored, compared, and transmitted for the rest of its life. The brand’s per-mint cost ranges from minus 13 nanoseconds (Rust) to plus 335 (today’s Node); its per-life return is fixed: 8 bytes per key at rest on the measured table (65 against 73), 5 bytes on every wire hop, and a fixed-width, type-bearing token at every gate.
Source: content/bcs1.a1.md · the whole-system accounting + boundaries. The per-mint column is the only one where the brand ever pays.
Minted once, cheaper forever
content/bcs1.a1.md · the whole-system accountingEven the worst case amortizes immediately — a Node service minting ten thousand ids a second spends 3.35 milliseconds of CPU per second, a third of one percent of a core, while every one of those keys is cheaper in the store and shorter on every message it ever rides. The sentence from Chapter 1.3 survives the CPU question intact, with one runtime’s asterisk and its remedy already named: the contract’s wire form is cheaper than the “lean” alternative it is usually defended against.
v22.22.2 node branded ns/op=381 node decimal ns/op=45.6
The loss is real and it sits in exactly the place the contract prescribes the wasm
crossing — the wasm codec already serves decode and hash32 through the
loader, and an encode export is the carried follow-up. Until it lands, the arithmetic
below keeps the loss in proportion.
The worst-case arithmetic, stepped
computed live from node_bench.outThat is the whole bill for the worst runtime on the table, at a mint rate few services reach — and every one of those ten thousand keys per second is 8 bytes cheaper at rest and 5 bytes shorter on every hop, for as long as it lives.
Boundaries
content/bcs1.a1.md · boundariesOne host, the recorded toolchains; ratios travel better than absolute numbers. The Go rows compare what the APIs return, so the regime note is part of the result, not a caveat to it. The Elixir row is the native path; the pure path is conformance-covered but not separately timed here. The Node row is the pure-TypeScript implementation by construction — the wasm encode export does not exist yet, which is the point of measuring its absence. Storage figures and their allocator-class mechanics are Chapter 1.3’s, inherited verbatim:
fmt keylen redis7 valkey81 saved brd14 14 88 65 23 u64dec 19 104 73 31
The bus this return rides is Part III’s subject — EchoMQ, where every job key, stream entry, and lock token is a branded id on the wire. The hops this ledger counts are taught in depth on the far side of that door.
References
sources · relatedSources
- Söderqvist — A new hash tablethe single-allocation entries behind the 65-against-73 step
- Wikipedia — Snowflake IDthe integer whose decimal shadow loses the accounting
Related
- B1.6 — Branding Beats Its Own Integerthe module hub; the appendix in context
- B1.3 — The ID Systemthe storage record — 65 against 73 — the return column inherits
- EchoMQ — the coursethe bus where every key rides the hops this ledger counts
- B1 — Ideas Behindthe chapter landing; the Part I arc