Repository navigation
v0.1.3
Bandal v0.1.3 — Faster than pandas across the benchmark suite
v0.1.3 is a performance release. Every workload in the pandas comparison benchmark now runs at or above pandas speed under all four execution policies (native, cpu, gpu, gpuFloat32). Checksums still match pandas (match: ok). There are no public API changes.
Performance (5,000,000 rows, speedup vs pandas)
| Workload | v0.1.3 |
|---|---|
left_join |
~130x |
groupby_sum |
~30x |
sort |
~6.3x |
correlation |
~6x (native/CPU), 4.4x (GPU) |
filter |
~6x |
expanding(.sum) |
~5x |
rolling(.mean, window: 20) |
~2.7x |
summary() |
1.5x (CPU) – 3.3x (GPU) |
arithmetic + sqrt |
~1.1x |
Median computation time only, pandas 3.1.1 vs Bandal. Reproduce with Scripts/benchmark.sh --rows 100000,1000000,5000000.
Highlights
- Rolling and expanding windows:
sum,meanandcountnow use a native single-pass O(n) kernel with Neumaier-compensated summation. They no longer go through MLX prefix sums, which were about 0.5x of pandas under the MLX policies. - Element-wise arithmetic and
sqrt:+ - * /andsqrtuse a single-pass SIMD kernel that checks the result is finite as part of the write loop, with no separate validation pass. The native-policy fallback shares the same kernel. - GPU
Float32path:sqrtandsignno longer use it, because theDouble↔Floatconversion costs more than the GPU saves. - Columnar engine (Phase 8): unboxed typed paths for group-by, joins, sorting, filtering and
BitSetslicing, plus O(N) sliding-window kernels.
Quality
- 69 tests pass with
swift testandScripts/test-with-mlx.sh. - New tests cover sliding and expanding windows with missing values across execution policies, sliding-sum accuracy after a large value leaves the window, and chained multiply → add →
sqrtwith negative inputs.
Upgrade
.package(url: "https://github.com/NeuroAssociates/Bandal.git", from: "0.1.3")