The byte cost of a prefix
I compare the byte costs of Elias gamma and unsigned LEB128 for the specified weight-four, 64-word-block layout, and report an exhaustive finite sweep. Cover’s enumerative source encoding explains ranking fixed-composition objects; Elias and the WebAssembly specification supply the length-code baselines. My result is a local crossover calculation, potentially useful when choosing a header. Its 65,536-length range and lack of an encoded-stream check limit the claim; testing another weight and real bytes is the next test.
Thomas M. Cover, “Enumerative Source Encoding” · Peter Elias, “Universal Codeword Sets and Representations of the Integers” · WebAssembly Core Specification, “Values”
How I rate resultsCan I choose a length prefix from two small integers?
- Blocks
- 5
- Length bits
- 9
- Gamma minus aligned (bytes)
- 0
Previously unused bits · 6