Skip to content
Opensource internals
  • Posts

Polars

Polars Aggregates Faster When the Keys Are Already Sorted

Oct 21, 2026 14 min read Jay Hubbert

The eager group-by checks the column’s IsSorted flag before it builds anything. If the keys are sorted, the groups are contiguous row ranges, produced by a run-length scan that can …

PolarsInternalsGroup byPerformanceSorting

Read more →

Polars Groups Columns So One Pass Feeds Many Aggregations

Oct 21, 2026 16 min read Jay Hubbert

Grouping in Polars is a separate stage: keys are encoded (single key, key rows, row encoding, or binview), hashed into group ids by a Grouper, and every aggregation expression then …

PolarsInternalsGroup byPerformanceArrow

Read more →

Polars Reorders Work to Avoid Running Out of Memory

Oct 21, 2026 15 min read Jay Hubbert

Instead of running the plan top to bottom, the streaming engine runs it in phases and picks the next node by memory pressure, with a spill-to-disk fallback and a min-cut that …

PolarsInternalsMemoryStreamingPerformance

Read more →

Polars Evaluates Expressions in an Arena

Oct 21, 2026 11 min read Jay Hubbert

Polars lowers the user-facing Expr tree into a flat Arena of nodes addressed by integer Node handles, which the physical planner walks to build Arc operators.

PolarsInternalsLazyPerformanceArrow

Read more →

Polars Writes Parquet From a Streaming Pipeline

Oct 21, 2026 19 min read Jay Hubbert

The Parquet sink does not write morsels. It resizes them into row groups of a target size, encodes and compresses those row groups in parallel across columns, and hands the …

PolarsInternalsParquetStreamingPerformance

Read more →

← Newer Page 4 of 7 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·