vu128: Efficient variable-length integers

Variable-length integers are essential for encoding small numbers efficiently, especially in TLV formats like Protocol Buffers for space optimization. Popular encodings include VLQ and LEB128, but the author developed a simpler, faster alternative named vu128 due to LEB128’s poor fit for modern processors. The vu128 format stores unsigned integers up to 128 bits in a concise manner, supporting zigzag encoding for signed integers and big-endian storage for IEEE-754 floating-point values. A Rust implementation demonstrates significant speed improvements over standard LEB128 encoding, making it a compelling choice for efficient integer encoding in various applications.

https://john-millikin.com/vu128-efficient-variable-length-integers

To top