More Software Engineering Radio episodes

Jeroen Janssens and Thijs Nieuwdorp on Using Polars thumbnail

Jeroen Janssens and Thijs Nieuwdorp on Using Polars

Published 2 Jul 2026

Duration: 01:02:16

The *polars* library offers a high-performance, multi-language (Python, R, Node.js) data frame tool leveraging Rust, columnar storage, out-of-core processing, and GPU acceleration for fast data manipulation, optimized for large datasets and scalable data engineering workflows.

Episode Description

Jeroen Janssens, a senior developer relations engineer at Posit, and Thijs Nieuwdorp, a developer relations engineer at Polars, speak with host Gregor...

Overview

The podcast discusses the polars library, a high-performance data frame implementation written in Rust with language bindings for Python, R, and Node.js. Designed for speed, it outperforms alternatives like pandas and has evolved over five years through iterative improvements. The library emphasizes a columnar storage model based on Apache Arrow, which enhances analytical efficiency by allowing selective column access, unlike traditional row-based storage. Key features include out-of-core processing for large datasets via streaming and spill-to-disk mechanisms, along with a declarative API that aligns with SQL-like logic, avoiding procedural row-wise operations. Polars supports advanced data transformations such as joins, aggregations, and pivot/unpivot operations, tailored for tidy data workflows. Its declarative approach reduces complexity, with expressions forming the foundation for data manipulation, enabling scalable and readable code through left-to-right operation chaining.

The discussion also highlights polars' use cases in data engineering and science, driven by its performance and intuitive design, with examples like aggregating sales data using group-by and sum operations. It contrasts with pandas in programming style, favoring declarative definitions over procedural step-by-step commands. Polars supports both lazy and eager execution modes, with lazy mode optimizing query plans for large-scale data. The library's ecosystem includes a dedicated book authored by industry practitioners and ongoing development of cloud-native, distributed computing capabilities. Performance benchmarks demonstrate significant reductions in computation time and cost, as seen in a case study where migrating from pandas to polars cut processing costs by 98%. Additionally, polars handles specialized tasks like time-series analysis, vector similarity searches, and GPU acceleration for join-heavy queries, though row-wise operations are discouraged in favor of columnar processing for optimal efficiency.

What If

  • What if you rewrote your current data pipelines using Polars' declarative API for faster processing?

    • Move: Replace pandas-based workflows with Polars, focusing on expression-based data transformations (e.g., group_by, sum, and join operations). Prioritize declarative syntax over procedural steps.
    • Why Now?: Polars' performance optimizations (e.g., 5 years of iterative improvements, Rust-based core) make it viable for immediate speed gains, especially for repetitive data tasks like aggregation.
    • Expected Upside: Reduce query execution time by 310x, lower memory overhead, and simplify code maintenance via intuitive, SQL-like syntax.
  • What if you tested Polars' out-of-core processing with spill-to-disk on a dataset exceeding your systems RAM?

    • Move: Load a large dataset (e.g., >10GB) into Polars using the scan_parquet method, enable spill-to-disk, and perform transformations like filtering, grouping, or pivoting. Monitor memory usage in task manager or htop.
    • Why Now?: As datasets grow (e.g., logs, IoT data), spill-to-disk becomes critical for cost-effective analysis without cloud upgrades. Polars' streaming engine supports this natively.
    • Expected Upside: Process datasets 25x larger than your systems memory capacity, with ~1030% runtime penalty for disk I/O, but no hardware upgrades required.
  • What if you migrated join-heavy queries to a GPU environment to exploit Polars vectorization and parallelism?

    • Move: Set up a local GPU instance (e.g., NVIDIA GPU with CUDA), configure Polars to use GPU acceleration, and rewrite join-heavy operations (e.g., time-series alignment, customer-seller matching). Use PL.lazy() for query planning.
    • Why Now?: Join-heavy queries (e.g., financial tickers, geospatial lookups) can see up to 13x speedups on GPUs, especially for large datasets. This aligns with Polars roadmap for distributed GPU support.
    • Expected Upside: Reduce runtime for complex joins by 515x on GPUs, enabling real-time analytics for applications like fraud detection or high-frequency trading.

Takeaway

  • Leverage Polars' Lazy API for Query Optimization
    Use the lazy execution mode to delay computations until the end of a workflow, allowing the internal query optimizer to generate an efficient execution plan. This reduces memory usage and improves performance for large datasets, especially when working with formats like Parquet.

  • Adopt Columnar Storage Formats (e.g., Parquet)
    Prioritize Parquet or other columnar formats for large datasets to take advantage of Polars' columnar processing capabilities. This reduces memory overhead and accelerates analytical queries by enabling selective column access and compression.

  • Use Declarative Expressions for Data Manipulation
    Replace row-wise operations with Polars' declarative API, which uses expressions (e.g., PL.call("X") + PL.call("Y")) to define transformations. This improves readability, scalability, and performance by avoiding temporary variables and enabling efficient column-wise operations.

  • Enable Spill-to-Disk for Memory-Intensive Workloads
    Configure Polars to spill intermediate results to disk when working with datasets larger than available memory. This allows processing of larger data volumes, though it may slightly increase runtime due to disk I/O overhead.

  • Benchmark and Migrate from Pandas for Cost Efficiency
    Identify performance-critical workflows and benchmark them using Polars against Pandas. Migrate to Polars for significant speedups (e.g., 30 seconds to 1.2 seconds) and cost reductions (e.g., 150k to 3.5k), especially for large-scale data processing and transformations.

Recent Episodes of Software Engineering Radio

24 Jun 2026 Scott Kingsley on the Swagger Ecosystem

The Swagger/OpenAPI ecosystem, including tools like Swagger Editor, UI, and Codegen, along with commercial offerings and contract testing, supports cross-functional API development, evolves from Swagger 1.0/2.0 to OpenAPI under the Linux Foundation, emphasizes language-agnostic JSON/YAML specs, HTTP-centric design, modernization of legacy APIs, balances open-source and commercial tooling, explores JSON/YAML trade-offs, FastAPI integration, contract-first/code-first approaches, AI-driven spec generation, security practices, tooling challenges, governance, linting, mocking, CI/CD validation, and emerging AI-enhanced API trends.

10 Jun 2026 Jure Leskovec on Relational Graph and Foundational Models

Predictive modeling faces challenges with AI's limitations in structured data, prompting solutions like graph databases and relational deep learning with attention mechanisms to enhance accuracy, scalability, and real-time updates for enterprise applications.

3 Jun 2026 Dave Airlie on Linux Kernel Maintenance

The Linux kernel, the largest global software project, uses a hierarchical maintainer system with 80,150 contributors managing subsystems like DRM through public review, structured development cycles, and evolving practices to address scalability, quality, and integration challenges.

27 May 2026 Dwayne McDaniel on the Engineering Challenges of Secrets Management

Managing secrets like credentials and API keys in software development risks leaks causing supply chain attacks (e.g., PyPy, Clot, Cisco) due to secrets sprawl, plaintext storage, and misuse, prompting solutions like time-bound credentials, decentralized systems, vault tools (e.g., HashiCorp Vault), and strategies such as credential rotation and encrypted storage amid over 28.65 million hard-coded secrets in GitHub in 2025.

20 May 2026 Rob Moffat on Risk-First Software Development

Recommended: Risk identification and management is a forgotten art

Software development prioritizes risk management through frameworks like test-driven development and agile, addressing hidden risks, AI deployment challenges, open-source dependencies, and organizational prioritization to balance innovation with safeguards.

More Software Engineering Radio episodes