Avatar for the pola-rs user
pola-rs
polars
BlogDocsChangelog

perf: Use List's TotalEqKernel

#18984Merged
Comparing
coastalwhite:perf/list-eq-kernel
(
bfa1d64
) with
main
(
6abc2f1
)
CodSpeed Performance Gauge
0%
Untouched
40
Ignored
1

Benchmarks

Passed

test_pdsh_q15
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q15
CodSpeed Performance Gauge
+13%
2.5 ms2.2 ms
test_pdsh_q11
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q11
CodSpeed Performance Gauge
+10%
4 ms3.6 ms
test_pdsh_q12
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q12
CodSpeed Performance Gauge
+9%
6.2 ms5.7 ms
test_groupby_h2oai_q10
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q10
CodSpeed Performance Gauge
+7%
6.4 ms6 ms
test_groupby_h2oai_q7
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q7
CodSpeed Performance Gauge
+6%
2.2 ms2.1 ms
test_pdsh_q17
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q17
CodSpeed Performance Gauge
+5%
6.9 ms6.6 ms
test_pdsh_q2
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q2
CodSpeed Performance Gauge
+5%
3.6 ms3.4 ms
test_pdsh_q5
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q5
CodSpeed Performance Gauge
+3%
4.9 ms4.8 ms
test_pdsh_q13
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q13
CodSpeed Performance Gauge
+2%
9.8 ms9.6 ms
test_pdsh_q7
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q7
CodSpeed Performance Gauge
+2%
9.4 ms9.2 ms
test_pdsh_q8
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q8
CodSpeed Performance Gauge
+2%
5.3 ms5.2 ms
test_pdsh_q9
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q9
CodSpeed Performance Gauge
+1%
25.7 ms25.5 ms
test_pdsh_q4
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q4
CodSpeed Performance Gauge
+1%
4.6 ms4.6 ms
test_strict_inequalities
py-polars/tests/benchmark/test_join_where.py::test_strict_inequalities
CodSpeed Performance Gauge
0%
169.5 ms168.7 ms
test_groupby_h2oai_q2
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q2
CodSpeed Performance Gauge
0%
4.5 ms4.5 ms
test_pdsh_q21
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q21
CodSpeed Performance Gauge
0%
213.3 ms212.6 ms
test_groupby_h2oai_q3
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q3
CodSpeed Performance Gauge
0%
2.3 ms2.3 ms
test_non_strict_inequalities
py-polars/tests/benchmark/test_join_where.py::test_non_strict_inequalities
CodSpeed Performance Gauge
0%
174.3 ms173.8 ms
test_single_inequality
py-polars/tests/benchmark/test_join_where.py::test_single_inequality
CodSpeed Performance Gauge
0%
80.7 ms80.6 ms
test_to_numpy_series_with_nulls
py-polars/tests/benchmark/interop/test_numpy.py::test_to_numpy_series_with_nulls
CodSpeed Performance Gauge
0%
435 µs434.7 µs
test_to_numpy_series_zero_copy
py-polars/tests/benchmark/interop/test_numpy.py::test_to_numpy_series_zero_copy
CodSpeed Performance Gauge
0%
123.5 µs123.5 µs
test_to_numpy_series_chunked
py-polars/tests/benchmark/interop/test_numpy.py::test_to_numpy_series_chunked
CodSpeed Performance Gauge
0%
269.6 µs269.7 µs
test_pdsh_q18
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q18
CodSpeed Performance Gauge
0%
11.5 ms11.5 ms
test_pdsh_q19
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q19
CodSpeed Performance Gauge
0%
7.4 ms7.4 ms
test_groupby_h2oai_q9
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q9
CodSpeed Performance Gauge
0%
27.7 ms27.8 ms
test_write_read_scan_large_csv
py-polars/tests/benchmark/test_io.py::test_write_read_scan_large_csv
CodSpeed Performance Gauge
0%
30.8 ms30.9 ms
test_groupby_h2oai_q1
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q1
CodSpeed Performance Gauge
-1%
2.3 ms2.3 ms
test_groupby_h2oai_q6
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q6
CodSpeed Performance Gauge
-1%
12.5 ms12.7 ms
test_pdsh_q22
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q22
CodSpeed Performance Gauge
-1%
6.4 ms6.4 ms
test_pdsh_q3
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q3
CodSpeed Performance Gauge
-2%
5.6 ms5.7 ms
test_pdsh_q16
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q16
CodSpeed Performance Gauge
-2%
7.3 ms7.4 ms
test_pdsh_q6
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q6
CodSpeed Performance Gauge
-2%
1.9 ms1.9 ms
test_groupby_h2oai_q5
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q5
CodSpeed Performance Gauge
-3%
1.8 ms1.8 ms
test_groupby_h2oai_q8
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q8
CodSpeed Performance Gauge
-3%
2.9 ms3 ms
test_pdsh_q20
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q20
CodSpeed Performance Gauge
-3%
6 ms6.2 ms
test_pdsh_q1
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q1
CodSpeed Performance Gauge
-4%
15.9 ms16.6 ms
test_groupby_h2oai_q4
py-polars/tests/benchmark/test_group_by.py::test_groupby_h2oai_q4
CodSpeed Performance Gauge
-5%
1.9 ms2 ms
test_filter1
py-polars/tests/benchmark/test_filter.py::test_filter1
CodSpeed Performance Gauge
-6%
712 µs758.6 µs
test_pdsh_q10
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q10
CodSpeed Performance Gauge
-7%
6 ms6.4 ms
test_pdsh_q14
py-polars/tests/benchmark/test_pdsh.py::test_pdsh_q14
CodSpeed Performance Gauge
-8%
2.1 ms2.3 ms

Ignored

test_filter2
py-polars/tests/benchmark/test_filter.py::test_filter2
Ignored
CodSpeed Performance Gauge
+6%
1.1 ms1 ms

Commits

Click on a commit to change the comparison range
Base
main
6abc2f1
+0.33%
perf: Use List's TotalEqKernel This utilizes `List`'s variant of `TotalEqKernel` and implements broadcasting for that kernel. This gives a nice speed-up, reduces code-bloat and reduces chance of bugs. For a measure on how much faster this is I did a microbenchmark: ```python import polars as pl import numpy as np from timeit import timeit lists = [None] + [list(range(i)) for i in range(11)] a = [lists[length] for length in np.random.randint(0, 11, 1_000_000)] b = [lists[length] for length in np.random.randint(0, 11, 1_000_000)] a = pl.Series('a', a) b = pl.Series('b', b) t = timeit(lambda: a == b, number=100) print(f"Time: {t:.2}s") ``` - Before: `Time: 16s` - After: `Time: 1.9s` I feel like there is more that can be done to make this a lot faster, but I feel like this is good enough for now.
bfa1d64
1 year ago
by coastalwhite
© 2025 CodSpeed Technology
Home Terms Privacy Docs