Polars Compares Strings Without Allocating
A BinaryView is 16 bytes: a length, a 4-byte prefix, and either 12 inline bytes or a buffer location. Equality is decided by two u64 compares before any byte of string data is …
A BinaryView is 16 bytes: a length, a 4-byte prefix, and either 12 inline bytes or a buffer location. Equality is decided by two u64 compares before any byte of string data is …
The categorical dtype is a thin wrapper over a global, lock-free string-to-u32 dictionary. The trick turns group-by and joins into integer work; the same shared state leaks across …
Every column in Polars is a list of immutable Arrow arrays plus cached length and null-count. Kernels run chunk by chunk, so chunk boundaries decide the unit of work, the unit of …
Column bytes live in refcounted buffers; sharing a column clones handles, and the Arrow FFI imports foreign memory by keeping the C array alive as the buffer’s owner.
The View type packs a 4-byte length, 4-byte prefix, buffer index and offset into 16 bytes, and inlines any string of 12 bytes or less directly into those bytes.