Skip to content
Opensource internals
  • Posts

Polars

Polars Compares Strings Without Allocating

Oct 21, 2026 19 min read Jay Hubbert

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 …

PolarsInternalsPerformanceStringsSimd

Read more →

Polars' Categorical Encoding Hides a Global Mutable Dictionary in Plain Sight

Oct 21, 2026 13 min read Jay Hubbert

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 …

PolarsInternalsPerformanceCategoricalCaching

Read more →

Polars Chunks Its Columns So Parallelism Has Something to Eat

Oct 21, 2026 18 min read Jay Hubbert

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 …

PolarsInternalsPerformanceMemoryParallelism

Read more →

Polars Shares Columns Instead of Copying Them: Arc, Bytes and Reference Counting

Oct 21, 2026 12 min read Jay Hubbert

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.

PolarsInternalsMemoryArrowConcurrency

Read more →

Polars Stores Short Strings Inline in 16 Bytes: The View Type

Oct 21, 2026 15 min read Jay Hubbert

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.

PolarsInternalsStringsArrowMemory

Read more →

← Newer Page 6 of 7 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·