Skip to content

Optimize IN performance with specialized implementations#19390

Closed
geoffreyclaude wants to merge 11 commits into
apache:mainfrom
geoffreyclaude:perf/in_list_optims
Closed

Optimize IN performance with specialized implementations#19390
geoffreyclaude wants to merge 11 commits into
apache:mainfrom
geoffreyclaude:perf/in_list_optims

Conversation

@geoffreyclaude

@geoffreyclaude geoffreyclaude commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Status

This aggregate PR has been superseded by the split stacked series for #19241.

The review path is now:

  1. IN LIST: clean up generic static filtering #21927: generic static-filter cleanup and fallback optimization
  2. IN LIST: add UInt8 bitmap filter #23011: Bitmap filter for UInt8
  3. IN LIST: add UInt16 bitmap filter #23012: Bitmap filter for UInt16
  4. IN LIST: reinterpret small-width types for bitmap filters #23013: zero-copy reinterpretation for 1-byte and 2-byte bitmap paths
  5. IN LIST: add branchless filter for small primitive lists #23014: branchless filter for small primitive lists
  6. IN LIST: add direct-probe hash filter for large primitive lists #23015: direct-probe hash filter for large primitive lists
  7. IN LIST: add string-view filters for Utf8View and BinaryView #23016: string-view filters for Utf8View and BinaryView
  8. IN LIST: add two-stage filter for Utf8 and LargeUtf8 #23017: two-stage filter for legacy Utf8 and LargeUtf8
  9. IN LIST: reinterpret FixedSizeBinary for primitive fast paths #23018: zero-copy reinterpretation for FixedSizeBinary

Each PR now owns one focused step in the optimization stack, with its own explanation and CI signal. Closing this aggregate PR avoids duplicate review on the same work.

#19241 remains the umbrella issue for the overall IN LIST performance work.

@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Dec 18, 2025
@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

run benchmark in_list

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch_bench.sh compare_branch_bench.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (f2a2503) to d68b629 diff
BENCH_NAME=in_list
BENCH_COMMAND=cargo bench --features=parquet --bench in_list
BENCH_FILTER=
BENCH_BRANCH_NAME=perf_in_list_optims
Results will be posted here when complete

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

group                                          main                                   perf_in_list_optims
-----                                          ----                                   -------------------
in_list/Float32/list=100/nulls=0%              1.55     58.7±0.39µs        ? ?/sec    1.00     37.9±0.89µs        ? ?/sec
in_list/Float32/list=100/nulls=20%             1.32     79.4±0.25µs        ? ?/sec    1.00     60.0±0.94µs        ? ?/sec
in_list/Float32/list=28/nulls=0%               1.28     51.1±0.31µs        ? ?/sec    1.00     39.9±0.91µs        ? ?/sec
in_list/Float32/list=28/nulls=20%              2.06     91.3±0.50µs        ? ?/sec    1.00     44.4±1.33µs        ? ?/sec
in_list/Float32/list=3/nulls=0%                6.60     41.9±0.74µs        ? ?/sec    1.00      6.4±0.03µs        ? ?/sec
in_list/Float32/list=3/nulls=20%               6.32     42.0±0.87µs        ? ?/sec    1.00      6.6±0.48µs        ? ?/sec
in_list/Float32/list=8/nulls=0%                4.25     49.1±0.40µs        ? ?/sec    1.00     11.6±0.06µs        ? ?/sec
in_list/Float32/list=8/nulls=20%               5.39     63.7±0.30µs        ? ?/sec    1.00     11.8±0.31µs        ? ?/sec
in_list/Int16/list=100/nulls=0%                6.17     49.6±0.21µs        ? ?/sec    1.00      8.0±0.03µs        ? ?/sec
in_list/Int16/list=100/nulls=20%               7.18     59.3±1.53µs        ? ?/sec    1.00      8.3±0.14µs        ? ?/sec
in_list/Int16/list=28/nulls=0%                 9.06     72.7±0.59µs        ? ?/sec    1.00      8.0±0.06µs        ? ?/sec
in_list/Int16/list=28/nulls=20%                5.98     49.1±0.18µs        ? ?/sec    1.00      8.2±0.03µs        ? ?/sec
in_list/Int16/list=3/nulls=0%                  4.81     38.5±1.10µs        ? ?/sec    1.00      8.0±0.06µs        ? ?/sec
in_list/Int16/list=3/nulls=20%                 4.58     37.8±0.74µs        ? ?/sec    1.00      8.2±0.04µs        ? ?/sec
in_list/Int16/list=8/nulls=0%                  5.38     43.6±0.59µs        ? ?/sec    1.00      8.1±0.20µs        ? ?/sec
in_list/Int16/list=8/nulls=20%                 5.06     41.7±1.25µs        ? ?/sec    1.00      8.2±0.07µs        ? ?/sec
in_list/Int32/list=100/nulls=0%                1.18     56.0±0.19µs        ? ?/sec    1.00     47.6±0.16µs        ? ?/sec
in_list/Int32/list=100/nulls=20%               1.02     66.1±0.30µs        ? ?/sec    1.00     65.1±0.56µs        ? ?/sec
in_list/Int32/list=28/nulls=0%                 1.15     83.2±0.27µs        ? ?/sec    1.00     72.6±2.27µs        ? ?/sec
in_list/Int32/list=28/nulls=20%                1.56     93.2±0.75µs        ? ?/sec    1.00     59.9±0.69µs        ? ?/sec
in_list/Int32/list=3/nulls=0%                  6.15     39.8±1.98µs        ? ?/sec    1.00      6.5±0.59µs        ? ?/sec
in_list/Int32/list=3/nulls=20%                 5.78     38.1±0.14µs        ? ?/sec    1.00      6.6±0.22µs        ? ?/sec
in_list/Int32/list=8/nulls=0%                  3.67     42.7±0.16µs        ? ?/sec    1.00     11.6±0.43µs        ? ?/sec
in_list/Int32/list=8/nulls=20%                 3.60     42.6±4.08µs        ? ?/sec    1.00     11.8±0.23µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=0%          1.68    102.3±1.83µs        ? ?/sec    1.00     60.8±0.99µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=20%         2.62    112.2±1.81µs        ? ?/sec    1.00     42.9±0.23µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=0%           1.00     70.3±0.28µs        ? ?/sec    1.07     75.5±0.65µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=20%          1.16   110.9±11.14µs        ? ?/sec    1.00     96.0±0.87µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=0%            5.42     53.4±0.90µs        ? ?/sec    1.00      9.9±0.03µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=20%           9.10     91.9±0.39µs        ? ?/sec    1.00     10.1±0.09µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=0%            2.25     58.0±2.34µs        ? ?/sec    1.00     25.8±0.40µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=20%           3.58     94.9±2.67µs        ? ?/sec    1.00     26.5±1.93µs        ? ?/sec
in_list/UInt8/list=100/nulls=0%                8.38     66.1±0.40µs        ? ?/sec    1.00      7.9±0.08µs        ? ?/sec
in_list/UInt8/list=100/nulls=20%               9.50     76.9±0.95µs        ? ?/sec    1.00      8.1±0.03µs        ? ?/sec
in_list/UInt8/list=28/nulls=0%                 7.72     60.9±1.21µs        ? ?/sec    1.00      7.9±0.04µs        ? ?/sec
in_list/UInt8/list=28/nulls=20%                6.03     48.6±0.35µs        ? ?/sec    1.00      8.1±0.06µs        ? ?/sec
in_list/UInt8/list=3/nulls=0%                  4.79     37.9±2.02µs        ? ?/sec    1.00      7.9±0.21µs        ? ?/sec
in_list/UInt8/list=3/nulls=20%                 4.67     37.7±0.93µs        ? ?/sec    1.00      8.1±0.09µs        ? ?/sec
in_list/UInt8/list=8/nulls=0%                  5.47     43.1±0.53µs        ? ?/sec    1.00      7.9±0.04µs        ? ?/sec
in_list/UInt8/list=8/nulls=20%                 5.34     43.2±0.40µs        ? ?/sec    1.00      8.1±0.13µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=100         1.05    157.8±1.59µs        ? ?/sec    1.00    150.2±3.55µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=12          1.03     89.2±1.29µs        ? ?/sec    1.00     87.0±0.29µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=3           1.00    105.5±2.55µs        ? ?/sec    1.18    124.6±3.80µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=100        1.07    183.6±3.33µs        ? ?/sec    1.00    171.0±2.87µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=12         1.06    138.2±0.84µs        ? ?/sec    1.00    130.4±3.51µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=3          1.00    132.9±1.93µs        ? ?/sec    1.08    143.9±4.00µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=100          1.05    141.2±3.41µs        ? ?/sec    1.00    134.4±2.19µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=12           1.07     81.4±1.31µs        ? ?/sec    1.00     76.4±1.57µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=3            1.00     89.1±0.49µs        ? ?/sec    1.04     92.5±0.35µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=100         1.02    172.1±3.29µs        ? ?/sec    1.00    169.3±6.31µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=12          1.00    131.1±2.17µs        ? ?/sec    1.18    154.9±2.66µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=3           1.00    146.5±2.48µs        ? ?/sec    1.06    154.6±1.30µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=100           1.06    128.9±2.08µs        ? ?/sec    1.00    121.7±0.54µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=12            1.10     71.5±5.86µs        ? ?/sec    1.00     65.3±0.30µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=3             1.03     71.8±1.00µs        ? ?/sec    1.00     69.8±1.49µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=100          1.00    154.8±3.95µs        ? ?/sec    1.00    155.1±1.14µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=12           1.00    109.4±0.45µs        ? ?/sec    1.01    110.8±0.62µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=3            1.00    111.6±3.55µs        ? ?/sec    1.03    115.5±0.72µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=100           1.09   138.7±15.15µs        ? ?/sec    1.00    127.0±1.18µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=12            1.04     75.4±0.93µs        ? ?/sec    1.00     72.2±9.40µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=3             1.05     78.0±0.44µs        ? ?/sec    1.00     74.3±0.40µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=100          1.00    158.9±6.78µs        ? ?/sec    1.01    160.4±4.45µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=12           1.00    114.1±0.59µs        ? ?/sec    1.02    116.2±0.88µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=3            1.00    116.8±5.02µs        ? ?/sec    1.03    119.9±0.31µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=100     1.00    160.9±1.19µs        ? ?/sec    1.08   174.3±11.20µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=12      1.18    117.1±0.67µs        ? ?/sec    1.00     99.3±1.42µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=3       1.95    100.3±0.38µs        ? ?/sec    1.00     51.5±0.35µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=100    1.00    192.6±1.37µs        ? ?/sec    1.04    200.0±0.69µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=12     1.63    122.4±0.74µs        ? ?/sec    1.00     75.3±1.40µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=3      1.76    134.0±0.42µs        ? ?/sec    1.00     76.1±0.36µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=100      1.00    168.5±1.55µs        ? ?/sec    1.03    173.6±1.48µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=12       1.17    113.7±3.69µs        ? ?/sec    1.00     97.2±1.03µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=3        1.00     82.4±0.46µs        ? ?/sec    1.20     98.6±1.17µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=100     1.00    213.4±5.15µs        ? ?/sec    1.03    219.0±1.54µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=12      2.97    155.7±1.73µs        ? ?/sec    1.00     52.5±0.22µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=3       1.64    126.9±0.91µs        ? ?/sec    1.00     77.5±0.58µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=100       1.07    135.7±0.79µs        ? ?/sec    1.00    127.0±0.90µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=12        4.50     69.5±0.40µs        ? ?/sec    1.00     15.4±0.05µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=3         4.66     72.1±1.73µs        ? ?/sec    1.00     15.5±0.28µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=100      1.00    165.7±1.41µs        ? ?/sec    1.00    165.5±7.06µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=12       7.16    112.6±1.92µs        ? ?/sec    1.00     15.7±0.37µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=3        7.43    116.8±2.24µs        ? ?/sec    1.00     15.7±0.44µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=100       1.06    140.2±1.09µs        ? ?/sec    1.00    131.9±2.82µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=12        1.58     75.8±7.92µs        ? ?/sec    1.00     48.0±0.81µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=3         1.57     76.3±0.39µs        ? ?/sec    1.00     48.6±1.07µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=100      1.00    167.3±0.90µs        ? ?/sec    1.01    168.7±3.47µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=12       2.42    115.7±2.88µs        ? ?/sec    1.00     47.8±0.78µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=3        2.51    119.5±0.58µs        ? ?/sec    1.00     47.6±0.85µs        ? ?/sec

Comment thread datafusion/physical-expr/src/expressions/in_list/array_filter.rs Outdated
Comment thread datafusion/physical-expr/src/expressions/in_list/array_filter.rs Outdated
@Dandandan

Copy link
Copy Markdown
Contributor

run benchmarks

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (f2a2503) to d68b629 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@Dandandan

Copy link
Copy Markdown
Contributor

run benchmark tpch tpchds

@alamb-ghbot

Copy link
Copy Markdown

🤖 Hi @Dandandan, thanks for the request (#19390 (comment)).

scrape_comments.py only supports whitelisted benchmarks.

  • Standard: clickbench_1, clickbench_extended, clickbench_partitioned, clickbench_pushdown, external_aggr, tpcds, tpch, tpch10, tpch_mem, tpch_mem10
  • Criterion: aggregate_query_sql, aggregate_vectorized, case_when, in_list, sql_planner, with_hashes

Please choose one or more of these with run benchmark <name> or run benchmark <name1> <name2>...
Unsupported benchmarks: tpchds.

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

Comparing HEAD and perf_in_list_optims
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ perf_in_list_optims ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │  2725.42 ms │          2806.89 ms │     no change │
│ QQuery 1     │  1205.55 ms │          1296.98 ms │  1.08x slower │
│ QQuery 2     │  2354.44 ms │          2501.12 ms │  1.06x slower │
│ QQuery 3     │  1158.78 ms │          1208.21 ms │     no change │
│ QQuery 4     │  2343.44 ms │          2328.86 ms │     no change │
│ QQuery 5     │ 29573.83 ms │         29313.99 ms │     no change │
│ QQuery 6     │  3988.57 ms │          4081.38 ms │     no change │
│ QQuery 7     │  3894.61 ms │          3628.87 ms │ +1.07x faster │
└──────────────┴─────────────┴─────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                  ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                  │ 47244.63ms │
│ Total Time (perf_in_list_optims)   │ 47166.29ms │
│ Average Time (HEAD)                │  5905.58ms │
│ Average Time (perf_in_list_optims) │  5895.79ms │
│ Queries Faster                     │          1 │
│ Queries Slower                     │          2 │
│ Queries with No Change             │          5 │
│ Queries with Failure               │          0 │
└────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ perf_in_list_optims ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.37 ms │             2.26 ms │     no change │
│ QQuery 1     │    52.91 ms │            51.62 ms │     no change │
│ QQuery 2     │   137.22 ms │           136.97 ms │     no change │
│ QQuery 3     │   157.06 ms │           160.07 ms │     no change │
│ QQuery 4     │  1179.83 ms │          1152.00 ms │     no change │
│ QQuery 5     │  1560.36 ms │          1540.33 ms │     no change │
│ QQuery 6     │     2.15 ms │             2.17 ms │     no change │
│ QQuery 7     │    56.53 ms │            56.82 ms │     no change │
│ QQuery 8     │  1509.57 ms │          1477.40 ms │     no change │
│ QQuery 9     │  1967.08 ms │          1895.92 ms │     no change │
│ QQuery 10    │   364.36 ms │           378.01 ms │     no change │
│ QQuery 11    │   423.25 ms │           433.69 ms │     no change │
│ QQuery 12    │  1475.13 ms │          1407.02 ms │     no change │
│ QQuery 13    │  2115.97 ms │          2059.29 ms │     no change │
│ QQuery 14    │  1363.18 ms │          1308.84 ms │     no change │
│ QQuery 15    │  1343.47 ms │          1261.13 ms │ +1.07x faster │
│ QQuery 16    │  2811.16 ms │          2756.23 ms │     no change │
│ QQuery 17    │  2778.01 ms │          2787.48 ms │     no change │
│ QQuery 18    │  5553.83 ms │          5159.05 ms │ +1.08x faster │
│ QQuery 19    │   125.28 ms │           125.76 ms │     no change │
│ QQuery 20    │  2052.66 ms │          1935.68 ms │ +1.06x faster │
│ QQuery 21    │  2324.36 ms │          2247.58 ms │     no change │
│ QQuery 22    │  3946.25 ms │          3838.61 ms │     no change │
│ QQuery 23    │ 16658.91 ms │         12406.56 ms │ +1.34x faster │
│ QQuery 24    │   227.66 ms │           221.15 ms │     no change │
│ QQuery 25    │   472.53 ms │           473.19 ms │     no change │
│ QQuery 26    │   239.05 ms │           219.07 ms │ +1.09x faster │
│ QQuery 27    │  2925.72 ms │          2766.22 ms │ +1.06x faster │
│ QQuery 28    │ 24656.05 ms │         23549.07 ms │     no change │
│ QQuery 29    │  1020.26 ms │           976.67 ms │     no change │
│ QQuery 30    │  1409.95 ms │          1338.93 ms │ +1.05x faster │
│ QQuery 31    │  1400.09 ms │          1337.21 ms │     no change │
│ QQuery 32    │  5774.13 ms │          5190.24 ms │ +1.11x faster │
│ QQuery 33    │  6407.01 ms │          6021.19 ms │ +1.06x faster │
│ QQuery 34    │  6500.51 ms │          6415.47 ms │     no change │
│ QQuery 35    │  2103.71 ms │          2017.51 ms │     no change │
│ QQuery 36    │    68.10 ms │            67.99 ms │     no change │
│ QQuery 37    │    47.03 ms │            48.20 ms │     no change │
│ QQuery 38    │    69.86 ms │            67.91 ms │     no change │
│ QQuery 39    │   106.08 ms │           105.06 ms │     no change │
│ QQuery 40    │    28.50 ms │            25.97 ms │ +1.10x faster │
│ QQuery 41    │    23.83 ms │            25.79 ms │  1.08x slower │
│ QQuery 42    │    21.20 ms │            21.21 ms │     no change │
└──────────────┴─────────────┴─────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Benchmark Summary                  ┃             ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Total Time (HEAD)                  │ 103462.18ms │
│ Total Time (perf_in_list_optims)   │  95468.54ms │
│ Average Time (HEAD)                │   2406.10ms │
│ Average Time (perf_in_list_optims) │   2220.20ms │
│ Queries Faster                     │          10 │
│ Queries Slower                     │           1 │
│ Queries with No Change             │          32 │
│ Queries with Failure               │           0 │
└────────────────────────────────────┴─────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ perf_in_list_optims ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 139.03 ms │           133.34 ms │     no change │
│ QQuery 2     │  28.29 ms │            30.88 ms │  1.09x slower │
│ QQuery 3     │  39.30 ms │            40.03 ms │     no change │
│ QQuery 4     │  29.65 ms │            29.76 ms │     no change │
│ QQuery 5     │  91.43 ms │            91.82 ms │     no change │
│ QQuery 6     │  20.10 ms │            20.37 ms │     no change │
│ QQuery 7     │ 243.33 ms │           246.44 ms │     no change │
│ QQuery 8     │  38.65 ms │            38.74 ms │     no change │
│ QQuery 9     │ 107.49 ms │           114.95 ms │  1.07x slower │
│ QQuery 10    │  66.38 ms │            67.41 ms │     no change │
│ QQuery 11    │  19.47 ms │            18.27 ms │ +1.07x faster │
│ QQuery 12    │  52.22 ms │            53.28 ms │     no change │
│ QQuery 13    │  50.39 ms │            51.38 ms │     no change │
│ QQuery 14    │  14.71 ms │            14.23 ms │     no change │
│ QQuery 15    │  26.27 ms │            25.97 ms │     no change │
│ QQuery 16    │  25.28 ms │            25.64 ms │     no change │
│ QQuery 17    │ 165.92 ms │           168.99 ms │     no change │
│ QQuery 18    │ 294.08 ms │           294.12 ms │     no change │
│ QQuery 19    │  39.69 ms │            38.75 ms │     no change │
│ QQuery 20    │  51.17 ms │            51.39 ms │     no change │
│ QQuery 21    │ 345.46 ms │           341.94 ms │     no change │
│ QQuery 22    │  18.11 ms │            17.48 ms │     no change │
└──────────────┴───────────┴─────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                  ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                  │ 1906.43ms │
│ Total Time (perf_in_list_optims)   │ 1915.18ms │
│ Average Time (HEAD)                │   86.66ms │
│ Average Time (perf_in_list_optims) │   87.05ms │
│ Queries Faster                     │         1 │
│ Queries Slower                     │         2 │
│ Queries with No Change             │        19 │
│ Queries with Failure               │         0 │
└────────────────────────────────────┴───────────┘

@Dandandan

Copy link
Copy Markdown
Contributor

run benchmark tpch tpcds

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (f2a2503) to d68b629 diff using: tpch
Results will be posted here when complete

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

Comparing HEAD and perf_in_list_optims
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query        ┃      HEAD ┃ perf_in_list_optims ┃    Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1     │ 231.35 ms │           223.32 ms │ no change │
│ QQuery 2     │ 101.95 ms │           100.61 ms │ no change │
│ QQuery 3     │ 130.96 ms │           131.08 ms │ no change │
│ QQuery 4     │  77.52 ms │            80.92 ms │ no change │
│ QQuery 5     │ 180.82 ms │           183.99 ms │ no change │
│ QQuery 6     │  66.39 ms │            68.45 ms │ no change │
│ QQuery 7     │ 221.26 ms │           225.37 ms │ no change │
│ QQuery 8     │ 169.39 ms │           169.80 ms │ no change │
│ QQuery 9     │ 234.35 ms │           233.20 ms │ no change │
│ QQuery 10    │ 191.96 ms │           191.30 ms │ no change │
│ QQuery 11    │  77.86 ms │            78.08 ms │ no change │
│ QQuery 12    │ 120.03 ms │           119.39 ms │ no change │
│ QQuery 13    │ 225.39 ms │           222.78 ms │ no change │
│ QQuery 14    │  99.23 ms │            97.40 ms │ no change │
│ QQuery 15    │ 124.72 ms │           126.19 ms │ no change │
│ QQuery 16    │  60.16 ms │            61.62 ms │ no change │
│ QQuery 17    │ 290.48 ms │           286.19 ms │ no change │
│ QQuery 18    │ 335.46 ms │           338.83 ms │ no change │
│ QQuery 19    │ 140.50 ms │           135.63 ms │ no change │
│ QQuery 20    │ 131.02 ms │           131.28 ms │ no change │
│ QQuery 21    │ 276.38 ms │           285.97 ms │ no change │
│ QQuery 22    │  43.92 ms │            44.97 ms │ no change │
└──────────────┴───────────┴─────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                  ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                  │ 3531.09ms │
│ Total Time (perf_in_list_optims)   │ 3536.36ms │
│ Average Time (HEAD)                │  160.50ms │
│ Average Time (perf_in_list_optims) │  160.74ms │
│ Queries Faster                     │         0 │
│ Queries Slower                     │         0 │
│ Queries with No Change             │        22 │
│ Queries with Failure               │         0 │
└────────────────────────────────────┴───────────┘

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (f2a2503) to d68b629 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

Comparing HEAD and perf_in_list_optims
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃        HEAD ┃ perf_in_list_optims ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │    62.81 ms │            63.40 ms │     no change │
│ QQuery 2     │   200.58 ms │           211.30 ms │  1.05x slower │
│ QQuery 3     │   157.02 ms │           161.27 ms │     no change │
│ QQuery 4     │  2147.68 ms │          2154.43 ms │     no change │
│ QQuery 5     │   266.90 ms │           272.12 ms │     no change │
│ QQuery 6     │  1608.53 ms │          1568.65 ms │     no change │
│ QQuery 7     │   516.14 ms │           516.20 ms │     no change │
│ QQuery 8     │   171.09 ms │           174.30 ms │     no change │
│ QQuery 9     │   279.10 ms │           278.52 ms │     no change │
│ QQuery 10    │   169.98 ms │           172.34 ms │     no change │
│ QQuery 11    │  1440.42 ms │          1456.00 ms │     no change │
│ QQuery 12    │    72.90 ms │            72.63 ms │     no change │
│ QQuery 13    │   569.65 ms │           573.00 ms │     no change │
│ QQuery 14    │  2058.14 ms │          2120.24 ms │     no change │
│ QQuery 15    │    27.41 ms │            29.18 ms │  1.06x slower │
│ QQuery 16    │    58.86 ms │            59.82 ms │     no change │
│ QQuery 17    │   356.40 ms │           360.71 ms │     no change │
│ QQuery 18    │   191.05 ms │           192.99 ms │     no change │
│ QQuery 19    │   228.87 ms │           231.37 ms │     no change │
│ QQuery 20    │    24.10 ms │            23.64 ms │     no change │
│ QQuery 21    │    34.13 ms │            36.03 ms │  1.06x slower │
│ QQuery 22    │  1049.93 ms │          1040.99 ms │     no change │
│ QQuery 23    │  1859.36 ms │          1882.59 ms │     no change │
│ QQuery 24    │   646.96 ms │           661.66 ms │     no change │
│ QQuery 25    │   525.98 ms │           526.04 ms │     no change │
│ QQuery 26    │   125.28 ms │           125.04 ms │     no change │
│ QQuery 27    │   501.63 ms │           520.79 ms │     no change │
│ QQuery 28    │   304.67 ms │           306.38 ms │     no change │
│ QQuery 29    │   437.65 ms │           452.99 ms │     no change │
│ QQuery 30    │    63.66 ms │            64.67 ms │     no change │
│ QQuery 31    │   299.10 ms │           319.80 ms │  1.07x slower │
│ QQuery 32    │    83.63 ms │            79.01 ms │ +1.06x faster │
│ QQuery 33    │   198.78 ms │           197.59 ms │     no change │
│ QQuery 34    │   165.32 ms │           162.00 ms │     no change │
│ QQuery 35    │   185.05 ms │           176.72 ms │     no change │
│ QQuery 36    │   296.82 ms │           312.84 ms │  1.05x slower │
│ QQuery 37    │   258.15 ms │           271.79 ms │  1.05x slower │
│ QQuery 38    │   151.03 ms │           156.34 ms │     no change │
│ QQuery 39    │   230.46 ms │           224.41 ms │     no change │
│ QQuery 40    │   192.88 ms │           196.48 ms │     no change │
│ QQuery 41    │    17.27 ms │            16.81 ms │     no change │
│ QQuery 42    │   144.01 ms │           147.78 ms │     no change │
│ QQuery 43    │   125.45 ms │           129.17 ms │     no change │
│ QQuery 44    │    16.41 ms │            15.86 ms │     no change │
│ QQuery 45    │    82.39 ms │            85.78 ms │     no change │
│ QQuery 46    │   335.51 ms │           347.39 ms │     no change │
│ QQuery 47    │  1393.13 ms │          1412.63 ms │     no change │
│ QQuery 48    │   425.26 ms │           424.93 ms │     no change │
│ QQuery 49    │   359.69 ms │           356.73 ms │     no change │
│ QQuery 50    │   342.99 ms │           358.46 ms │     no change │
│ QQuery 51    │   297.73 ms │           305.62 ms │     no change │
│ QQuery 52    │   142.42 ms │           148.88 ms │     no change │
│ QQuery 53    │   149.92 ms │           150.29 ms │     no change │
│ QQuery 54    │   218.63 ms │           218.03 ms │     no change │
│ QQuery 55    │   142.31 ms │           146.87 ms │     no change │
│ QQuery 56    │   193.07 ms │           196.69 ms │     no change │
│ QQuery 57    │   323.23 ms │           336.89 ms │     no change │
│ QQuery 58    │   533.04 ms │           537.14 ms │     no change │
│ QQuery 59    │   289.92 ms │           297.91 ms │     no change │
│ QQuery 60    │   202.35 ms │           204.30 ms │     no change │
│ QQuery 61    │   242.74 ms │           246.65 ms │     no change │
│ QQuery 62    │  1398.37 ms │          1350.48 ms │     no change │
│ QQuery 63    │   149.80 ms │           151.68 ms │     no change │
│ QQuery 64    │  1181.74 ms │          1196.44 ms │     no change │
│ QQuery 65    │   369.30 ms │           377.05 ms │     no change │
│ QQuery 66    │   395.77 ms │           396.50 ms │     no change │
│ QQuery 67    │   643.44 ms │           642.65 ms │     no change │
│ QQuery 68    │   393.11 ms │           392.83 ms │     no change │
│ QQuery 69    │   164.68 ms │           168.85 ms │     no change │
│ QQuery 70    │   514.64 ms │           536.96 ms │     no change │
│ QQuery 71    │   184.83 ms │           189.37 ms │     no change │
│ QQuery 72    │  2628.42 ms │          2605.00 ms │     no change │
│ QQuery 73    │   159.35 ms │           159.55 ms │     no change │
│ QQuery 74    │   894.53 ms │           915.98 ms │     no change │
│ QQuery 75    │   390.80 ms │           392.61 ms │     no change │
│ QQuery 76    │   192.34 ms │           190.95 ms │     no change │
│ QQuery 77    │   266.33 ms │           272.79 ms │     no change │
│ QQuery 78    │   963.48 ms │           968.34 ms │     no change │
│ QQuery 79    │   346.81 ms │           354.21 ms │     no change │
│ QQuery 80    │   505.89 ms │           501.59 ms │     no change │
│ QQuery 81    │    42.66 ms │            43.01 ms │     no change │
│ QQuery 82    │   293.69 ms │           303.02 ms │     no change │
│ QQuery 83    │    70.96 ms │            69.83 ms │     no change │
│ QQuery 84    │    64.83 ms │            64.59 ms │     no change │
│ QQuery 85    │   229.07 ms │           227.32 ms │     no change │
│ QQuery 86    │    62.15 ms │            59.60 ms │     no change │
│ QQuery 87    │   148.29 ms │           153.10 ms │     no change │
│ QQuery 88    │   241.41 ms │           253.95 ms │  1.05x slower │
│ QQuery 89    │   170.57 ms │           175.35 ms │     no change │
│ QQuery 90    │    36.47 ms │            38.72 ms │  1.06x slower │
│ QQuery 91    │   103.81 ms │            94.73 ms │ +1.10x faster │
│ QQuery 92    │    76.56 ms │            79.05 ms │     no change │
│ QQuery 93    │   272.15 ms │           268.56 ms │     no change │
│ QQuery 94    │    85.84 ms │            86.91 ms │     no change │
│ QQuery 95    │   262.50 ms │           267.70 ms │     no change │
│ QQuery 96    │   109.24 ms │           111.28 ms │     no change │
│ QQuery 97    │   188.91 ms │           195.71 ms │     no change │
│ QQuery 98    │   248.91 ms │           242.24 ms │     no change │
│ QQuery 99    │ 14932.12 ms │         15007.97 ms │     no change │
└──────────────┴─────────────┴─────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                  ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                  │ 53579.35ms │
│ Total Time (perf_in_list_optims)   │ 53997.54ms │
│ Average Time (HEAD)                │   541.21ms │
│ Average Time (perf_in_list_optims) │   545.43ms │
│ Queries Faster                     │          2 │
│ Queries Slower                     │          8 │
│ Queries with No Change             │         89 │
│ Queries with Failure               │          0 │
└────────────────────────────────────┴────────────┘

@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

run benchmark tpch tpcds

@Dandandan how do IN LIST in the tpch queries get planned?

I think once this optim is done, there could be a lot to reuse for broadcast joins...

@Dandandan

Copy link
Copy Markdown
Contributor

run benchmark tpch tpcds

@Dandandan how do IN LIST in the tpch queries get planned?

I think once this optim is done, there could be a lot to reuse for broadcast joins...

For plain (non dynamic) filters, I think based on a treshold (<= 3) it either gets planned as a chain of or expressions or using InListExpr.
Probably we can change the treshold if it's better for fewer elems as well for primitive types.

@geoffreyclaude geoffreyclaude force-pushed the perf/in_list_optims branch 2 times, most recently from 7ba1c85 to 276a37f Compare December 19, 2025 16:25
@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

run benchmark in_list

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch_bench.sh compare_branch_bench.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (d18b346) to d68b629 diff
BENCH_NAME=in_list
BENCH_COMMAND=cargo bench --features=parquet --bench in_list
BENCH_FILTER=
BENCH_BRANCH_NAME=perf_in_list_optims
Results will be posted here when complete

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

group                                                  main                                   perf_in_list_optims
-----                                                  ----                                   -------------------
in_list/Float32/list=100/nulls=0%                      1.30     60.4±1.06µs        ? ?/sec    1.00     46.6±0.25µs        ? ?/sec
in_list/Float32/list=100/nulls=20%                     1.19     74.8±0.74µs        ? ?/sec    1.00     63.0±0.39µs        ? ?/sec
in_list/Float32/list=28/nulls=0%                       2.28     72.2±0.53µs        ? ?/sec    1.00     31.7±0.16µs        ? ?/sec
in_list/Float32/list=28/nulls=20%                      2.10     67.6±0.36µs        ? ?/sec    1.00     32.2±2.11µs        ? ?/sec
in_list/Float32/list=3/nulls=0%                        7.15     45.3±0.73µs        ? ?/sec    1.00      6.3±0.02µs        ? ?/sec
in_list/Float32/list=3/nulls=20%                       6.33     41.2±0.13µs        ? ?/sec    1.00      6.5±0.10µs        ? ?/sec
in_list/Float32/list=8/nulls=0%                        4.27     49.4±0.67µs        ? ?/sec    1.00     11.6±0.07µs        ? ?/sec
in_list/Float32/list=8/nulls=20%                       3.74     44.2±0.21µs        ? ?/sec    1.00     11.8±0.28µs        ? ?/sec
in_list/Int16/list=100/nulls=0%                        7.19     57.5±0.49µs        ? ?/sec    1.00      8.0±0.04µs        ? ?/sec
in_list/Int16/list=100/nulls=20%                       8.78     72.3±7.56µs        ? ?/sec    1.00      8.2±0.06µs        ? ?/sec
in_list/Int16/list=28/nulls=0%                         7.06     56.4±0.39µs        ? ?/sec    1.00      8.0±0.05µs        ? ?/sec
in_list/Int16/list=28/nulls=20%                        7.27     59.8±0.48µs        ? ?/sec    1.00      8.2±0.05µs        ? ?/sec
in_list/Int16/list=3/nulls=0%                          5.02     40.1±6.48µs        ? ?/sec    1.00      8.0±0.04µs        ? ?/sec
in_list/Int16/list=3/nulls=20%                         4.65     38.4±0.47µs        ? ?/sec    1.00      8.2±0.11µs        ? ?/sec
in_list/Int16/list=8/nulls=0%                          4.62     42.3±0.26µs        ? ?/sec    1.00      9.1±2.43µs        ? ?/sec
in_list/Int16/list=8/nulls=20%                         5.02     41.5±0.44µs        ? ?/sec    1.00      8.3±0.22µs        ? ?/sec
in_list/Int32/list=100/nulls=0%                        1.51     91.3±0.48µs        ? ?/sec    1.00     60.4±0.20µs        ? ?/sec
in_list/Int32/list=100/nulls=20%                       1.60     79.8±0.66µs        ? ?/sec    1.00     49.9±0.49µs        ? ?/sec
in_list/Int32/list=28/nulls=0%                         2.49     79.5±1.94µs        ? ?/sec    1.00     31.9±0.58µs        ? ?/sec
in_list/Int32/list=28/nulls=20%                        1.77     56.7±0.18µs        ? ?/sec    1.00     32.0±0.23µs        ? ?/sec
in_list/Int32/list=3/nulls=0%                          6.11     38.7±0.40µs        ? ?/sec    1.00      6.3±0.07µs        ? ?/sec
in_list/Int32/list=3/nulls=20%                         5.88     38.5±0.94µs        ? ?/sec    1.00      6.5±0.14µs        ? ?/sec
in_list/Int32/list=8/nulls=0%                          3.62     42.1±0.17µs        ? ?/sec    1.00     11.6±0.39µs        ? ?/sec
in_list/Int32/list=8/nulls=20%                         3.50     41.3±0.15µs        ? ?/sec    1.00     11.8±0.06µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=0%                  1.05     67.1±1.11µs        ? ?/sec    1.00     63.9±0.37µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=20%                 3.29    124.4±0.56µs        ? ?/sec    1.00     37.8±0.22µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=0%                   1.61     75.2±0.69µs        ? ?/sec    1.00     46.6±0.14µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=20%                  2.14    101.9±1.05µs        ? ?/sec    1.00     47.7±0.17µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=0%                    4.37     53.8±0.27µs        ? ?/sec    1.00     12.3±0.06µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=20%                   7.35     92.1±0.44µs        ? ?/sec    1.00     12.5±0.04µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=0%                    2.21     57.3±0.33µs        ? ?/sec    1.00     25.9±0.22µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=20%                   3.61     96.8±9.21µs        ? ?/sec    1.00     26.8±2.58µs        ? ?/sec
in_list/UInt8/list=100/nulls=0%                        8.34     66.6±0.35µs        ? ?/sec    1.00      8.0±0.36µs        ? ?/sec
in_list/UInt8/list=100/nulls=20%                       9.44     76.5±0.58µs        ? ?/sec    1.00      8.1±0.11µs        ? ?/sec
in_list/UInt8/list=28/nulls=0%                         7.42     58.7±2.02µs        ? ?/sec    1.00      7.9±0.17µs        ? ?/sec
in_list/UInt8/list=28/nulls=20%                        6.45     52.7±0.56µs        ? ?/sec    1.00      8.2±0.04µs        ? ?/sec
in_list/UInt8/list=3/nulls=0%                          4.74     37.5±0.12µs        ? ?/sec    1.00      7.9±0.23µs        ? ?/sec
in_list/UInt8/list=3/nulls=20%                         4.65     37.6±3.90µs        ? ?/sec    1.00      8.1±0.05µs        ? ?/sec
in_list/UInt8/list=8/nulls=0%                          5.27     41.7±0.26µs        ? ?/sec    1.00      7.9±0.22µs        ? ?/sec
in_list/UInt8/list=8/nulls=20%                         5.25     42.5±0.52µs        ? ?/sec    1.00      8.1±0.07µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=100                 1.00    146.0±0.80µs        ? ?/sec    1.27    185.5±1.86µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=12                  1.00     93.1±4.16µs        ? ?/sec    1.32    123.2±1.00µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=3                   1.00     98.1±0.30µs        ? ?/sec    1.17   114.9±16.18µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=100                1.00    172.9±1.42µs        ? ?/sec    1.14    196.7±2.51µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=12                 1.00    140.5±1.15µs        ? ?/sec    1.02    143.0±1.08µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=3                  1.00    119.1±0.85µs        ? ?/sec    1.00    118.6±1.40µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=100                  1.00    142.3±3.80µs        ? ?/sec    1.25    177.7±0.88µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=12                   1.00     92.9±4.71µs        ? ?/sec    1.72    159.7±2.60µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=3                    1.00     82.8±2.12µs        ? ?/sec    1.87    155.2±4.21µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=100                 1.00    178.5±2.07µs        ? ?/sec    1.06    189.7±1.07µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=12                  1.15    150.1±3.06µs        ? ?/sec    1.00    130.4±0.73µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=3                   1.25    144.3±0.96µs        ? ?/sec    1.00    115.8±3.96µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=100                   1.00    129.1±4.24µs        ? ?/sec    1.17   150.5±19.48µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=12                    1.00     70.7±0.51µs        ? ?/sec    1.26     89.2±0.60µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=3                     1.00     72.1±1.30µs        ? ?/sec    1.30     93.7±0.73µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=100                  1.06    154.2±0.99µs        ? ?/sec    1.00    145.8±1.44µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=12                   1.07    108.6±0.46µs        ? ?/sec    1.00    101.9±0.82µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=3                    1.06    111.0±2.15µs        ? ?/sec    1.00    104.9±1.39µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=100                   1.00    134.0±4.84µs        ? ?/sec    1.14    152.6±1.79µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=12                    1.00     75.2±0.35µs        ? ?/sec    1.27     95.4±0.40µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=3                     1.00     76.2±2.09µs        ? ?/sec    1.30     98.9±2.35µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=100                  1.05    157.8±4.39µs        ? ?/sec    1.00    150.3±0.47µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=12                   1.11   117.5±14.54µs        ? ?/sec    1.00    106.2±0.65µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=3                    1.05    115.2±0.82µs        ? ?/sec    1.00    109.5±0.78µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=0%/nulls=0%                                                 1.00    155.7±0.84µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=0%/nulls=20%                                                1.00    157.8±1.16µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=25%/nulls=0%                                                1.00   218.9±13.44µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=25%/nulls=20%                                               1.00    178.4±1.09µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=75%/nulls=0%                                                1.00    195.4±3.97µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=75%/nulls=20%                                               1.00   216.0±11.18µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=0%/nulls=0%                                                  1.00    199.2±0.77µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=0%/nulls=20%                                                 1.00    150.5±1.96µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=25%/nulls=0%                                                 1.00    222.5±0.94µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=25%/nulls=20%                                                1.00    178.8±1.14µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=75%/nulls=0%                                                 1.00    197.7±4.35µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=75%/nulls=20%                                                1.00    225.4±4.27µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=0%/nulls=0%                                                   1.00    123.9±2.71µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=0%/nulls=20%                                                  1.00    133.0±0.91µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=25%/nulls=0%                                                  1.00    158.3±1.39µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=25%/nulls=20%                                                 1.00    163.9±5.62µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=75%/nulls=0%                                                  1.00    177.6±6.66µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=75%/nulls=20%                                                 1.00    212.9±5.21µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=0%/nulls=0%                                                   1.00    129.9±1.70µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=0%/nulls=20%                                                  1.00    137.6±1.55µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=25%/nulls=0%                                                  1.00    176.4±1.30µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=25%/nulls=20%                                                 1.00    170.3±1.39µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=75%/nulls=0%                                                  1.00    186.5±5.64µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=75%/nulls=20%                                                 1.00    212.1±7.79µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=100             2.48    164.3±5.30µs        ? ?/sec    1.00     66.2±0.44µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=12              1.26     89.6±0.84µs        ? ?/sec    1.00     71.4±0.31µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=3               2.26    130.3±0.58µs        ? ?/sec    1.00     57.6±1.08µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=100            1.99    181.1±4.23µs        ? ?/sec    1.00     91.2±0.49µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=12             2.16    145.1±7.32µs        ? ?/sec    1.00     67.3±0.16µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=3              1.95    121.3±0.60µs        ? ?/sec    1.00     62.1±0.90µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=100              2.66    164.8±0.59µs        ? ?/sec    1.00     62.0±2.47µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=12               1.72     90.2±0.35µs        ? ?/sec    1.00     52.5±0.22µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=3                2.31    125.3±1.87µs        ? ?/sec    1.00     54.1±0.30µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=100             3.30    211.5±1.23µs        ? ?/sec    1.00     64.0±0.50µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=12              1.49    158.6±1.39µs        ? ?/sec    1.00    106.4±1.02µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=3               1.66    149.8±8.63µs        ? ?/sec    1.00     90.4±1.24µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=100               3.03    136.5±2.50µs        ? ?/sec    1.00     45.0±0.26µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=12                4.26     69.2±0.25µs        ? ?/sec    1.00     16.3±0.52µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=3                 4.39     71.0±0.36µs        ? ?/sec    1.00     16.2±0.09µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=100              3.19    165.7±1.40µs        ? ?/sec    1.00     51.9±0.13µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=12               6.81    112.5±0.49µs        ? ?/sec    1.00     16.5±0.31µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=3                7.07    115.9±0.59µs        ? ?/sec    1.00     16.4±0.06µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=100               3.05    140.7±2.44µs        ? ?/sec    1.00     46.1±1.42µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=12                1.54     74.4±0.47µs        ? ?/sec    1.00     48.2±0.47µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=3                 1.58     76.3±1.46µs        ? ?/sec    1.00     48.3±0.26µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=100              3.07    168.3±0.89µs        ? ?/sec    1.00     54.7±0.46µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=12               2.42    114.8±1.27µs        ? ?/sec    1.00     47.5±0.41µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=3                2.60   123.4±16.45µs        ? ?/sec    1.00     47.5±0.58µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=0%/nulls=0%                                             1.00    101.5±2.22µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=0%/nulls=20%                                            1.00     82.2±0.40µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=25%/nulls=0%                                            1.00    123.6±1.43µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=25%/nulls=20%                                           1.00    128.4±1.88µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=75%/nulls=0%                                            1.00    149.1±0.82µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=75%/nulls=20%                                           1.00    136.4±3.67µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=0%/nulls=0%                                              1.00     91.2±0.49µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=0%/nulls=20%                                             1.00     75.5±9.20µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=25%/nulls=0%                                             1.00    131.5±0.47µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=25%/nulls=20%                                            1.00    139.1±0.50µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=75%/nulls=0%                                             1.00    140.8±1.85µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=75%/nulls=20%                                            1.00    144.9±0.66µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=0%/nulls=0%                                               1.00     67.6±0.37µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=0%/nulls=20%                                              1.00     64.0±0.50µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=25%/nulls=0%                                              1.00    109.0±0.88µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=25%/nulls=20%                                             1.00   106.2±15.70µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=75%/nulls=0%                                              1.00    110.7±0.74µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=75%/nulls=20%                                             1.00    140.8±0.65µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=0%/nulls=0%                                               1.00     72.1±1.30µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=0%/nulls=20%                                              1.00     66.3±0.23µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=25%/nulls=0%                                              1.00    105.6±2.88µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=25%/nulls=20%                                             1.00    110.8±1.19µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=75%/nulls=0%                                              1.00    125.0±5.84µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=75%/nulls=20%                                             1.00    131.0±1.08µs        ? ?/sec

@geoffreyclaude geoffreyclaude force-pushed the perf/in_list_optims branch 3 times, most recently from 2fc00e5 to 3db393a Compare December 19, 2025 17:13
@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

run benchmark in_list

@alamb-ghbot

Copy link
Copy Markdown

🤖 ./gh_compare_branch_bench.sh compare_branch_bench.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing perf/in_list_optims (3db393a) to d68b629 diff
BENCH_NAME=in_list
BENCH_COMMAND=cargo bench --features=parquet --bench in_list
BENCH_FILTER=
BENCH_BRANCH_NAME=perf_in_list_optims
Results will be posted here when complete

@alamb-ghbot

Copy link
Copy Markdown

🤖: Benchmark completed

Details

group                                                  main                                   perf_in_list_optims
-----                                                  ----                                   -------------------
in_list/Float32/list=100/nulls=0%                      1.00     61.4±0.27µs        ? ?/sec    1.04     63.6±0.24µs        ? ?/sec
in_list/Float32/list=100/nulls=20%                     1.41    122.7±3.25µs        ? ?/sec    1.00     87.2±0.51µs        ? ?/sec
in_list/Float32/list=28/nulls=0%                       1.56     49.6±0.14µs        ? ?/sec    1.00     31.8±0.66µs        ? ?/sec
in_list/Float32/list=28/nulls=20%                      2.71     76.6±0.31µs        ? ?/sec    1.00     28.3±0.23µs        ? ?/sec
in_list/Float32/list=3/nulls=0%                        6.79     43.0±3.82µs        ? ?/sec    1.00      6.3±0.05µs        ? ?/sec
in_list/Float32/list=3/nulls=20%                       1.60     41.5±0.84µs        ? ?/sec    1.00     26.0±0.15µs        ? ?/sec
in_list/Float32/list=8/nulls=0%                        3.77     45.0±0.16µs        ? ?/sec    1.00     11.9±1.99µs        ? ?/sec
in_list/Float32/list=8/nulls=20%                       1.90     48.7±0.47µs        ? ?/sec    1.00     25.6±0.20µs        ? ?/sec
in_list/Int16/list=100/nulls=0%                        10.27    82.1±0.34µs        ? ?/sec    1.00      8.0±0.07µs        ? ?/sec
in_list/Int16/list=100/nulls=20%                       2.85     49.6±0.27µs        ? ?/sec    1.00     17.4±0.10µs        ? ?/sec
in_list/Int16/list=28/nulls=0%                         10.12    81.0±0.50µs        ? ?/sec    1.00      8.0±0.05µs        ? ?/sec
in_list/Int16/list=28/nulls=20%                        4.87     85.6±9.18µs        ? ?/sec    1.00     17.6±0.17µs        ? ?/sec
in_list/Int16/list=3/nulls=0%                          4.81     38.5±0.13µs        ? ?/sec    1.00      8.0±0.03µs        ? ?/sec
in_list/Int16/list=3/nulls=20%                         2.12     38.0±0.12µs        ? ?/sec    1.00     18.0±0.40µs        ? ?/sec
in_list/Int16/list=8/nulls=0%                          5.43     43.5±0.25µs        ? ?/sec    1.00      8.0±0.25µs        ? ?/sec
in_list/Int16/list=8/nulls=20%                         2.35     41.2±0.26µs        ? ?/sec    1.00     17.5±0.15µs        ? ?/sec
in_list/Int32/list=100/nulls=0%                        1.00     47.0±0.38µs        ? ?/sec    1.02     48.0±0.22µs        ? ?/sec
in_list/Int32/list=100/nulls=20%                       1.54     91.2±0.45µs        ? ?/sec    1.00     59.2±0.29µs        ? ?/sec
in_list/Int32/list=28/nulls=0%                         1.44     45.8±0.21µs        ? ?/sec    1.00     31.8±0.11µs        ? ?/sec
in_list/Int32/list=28/nulls=20%                        2.44     69.2±0.50µs        ? ?/sec    1.00     28.3±0.14µs        ? ?/sec
in_list/Int32/list=3/nulls=0%                          6.03     38.2±0.21µs        ? ?/sec    1.00      6.3±0.04µs        ? ?/sec
in_list/Int32/list=3/nulls=20%                         1.46     38.1±0.25µs        ? ?/sec    1.00     26.2±1.96µs        ? ?/sec
in_list/Int32/list=8/nulls=0%                          3.68     42.4±0.47µs        ? ?/sec    1.00     11.5±0.09µs        ? ?/sec
in_list/Int32/list=8/nulls=20%                         1.63     41.2±0.46µs        ? ?/sec    1.00     25.4±0.22µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=0%                  1.47     77.5±0.79µs        ? ?/sec    1.00     52.6±0.72µs        ? ?/sec
in_list/TimestampNs/list=100/nulls=20%                 1.92    127.3±1.09µs        ? ?/sec    1.00     66.5±1.93µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=0%                   1.21     62.6±4.44µs        ? ?/sec    1.00     52.0±0.80µs        ? ?/sec
in_list/TimestampNs/list=28/nulls=20%                  1.55    116.1±0.26µs        ? ?/sec    1.00     75.0±0.81µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=0%                    5.36     53.8±0.67µs        ? ?/sec    1.00     10.0±0.48µs        ? ?/sec
in_list/TimestampNs/list=3/nulls=20%                   3.56     92.9±3.25µs        ? ?/sec    1.00     26.1±0.17µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=0%                    2.55     58.1±0.36µs        ? ?/sec    1.00     22.8±0.24µs        ? ?/sec
in_list/TimestampNs/list=8/nulls=20%                   3.42     94.4±0.34µs        ? ?/sec    1.00     27.6±0.40µs        ? ?/sec
in_list/UInt8/list=100/nulls=0%                        8.26     71.4±1.78µs        ? ?/sec    1.00      8.6±0.28µs        ? ?/sec
in_list/UInt8/list=100/nulls=20%                       4.33     79.3±0.58µs        ? ?/sec    1.00     18.3±0.86µs        ? ?/sec
in_list/UInt8/list=28/nulls=0%                         6.37     54.7±0.30µs        ? ?/sec    1.00      8.6±0.04µs        ? ?/sec
in_list/UInt8/list=28/nulls=20%                        2.90     51.7±0.50µs        ? ?/sec    1.00     17.9±0.20µs        ? ?/sec
in_list/UInt8/list=3/nulls=0%                          4.27     36.5±0.37µs        ? ?/sec    1.00      8.5±0.37µs        ? ?/sec
in_list/UInt8/list=3/nulls=20%                         2.00     35.6±0.44µs        ? ?/sec    1.00     17.8±0.09µs        ? ?/sec
in_list/UInt8/list=8/nulls=0%                          5.00     43.1±0.35µs        ? ?/sec    1.00      8.6±0.12µs        ? ?/sec
in_list/UInt8/list=8/nulls=20%                         2.42     42.7±1.70µs        ? ?/sec    1.00     17.7±0.15µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=100                 1.00    160.3±0.54µs        ? ?/sec    1.09    174.4±1.20µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=12                  1.00     91.3±2.54µs        ? ?/sec    1.99    181.4±6.08µs        ? ?/sec
in_list/Utf8/list=100/nulls=0%/str=3                   1.00    107.7±3.18µs        ? ?/sec    1.38    148.9±1.70µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=100                1.00    178.7±1.33µs        ? ?/sec    1.05    188.2±1.78µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=12                 1.00    132.3±2.72µs        ? ?/sec    1.16    153.9±6.27µs        ? ?/sec
in_list/Utf8/list=100/nulls=20%/str=3                  1.00    168.4±4.06µs        ? ?/sec    1.01    169.6±1.76µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=100                  1.00    139.3±0.94µs        ? ?/sec    1.50    208.4±1.87µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=12                   1.14    122.4±2.14µs        ? ?/sec    1.00    107.8±0.69µs        ? ?/sec
in_list/Utf8/list=28/nulls=0%/str=3                    1.00     97.7±3.24µs        ? ?/sec    1.22    119.6±3.02µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=100                 1.00    182.4±2.03µs        ? ?/sec    1.11    203.0±0.87µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=12                  1.00    138.8±0.60µs        ? ?/sec    1.25    173.8±1.60µs        ? ?/sec
in_list/Utf8/list=28/nulls=20%/str=3                   1.00   123.4±10.84µs        ? ?/sec    1.18    146.0±0.37µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=100                   1.00    131.8±9.42µs        ? ?/sec    1.14   150.7±14.87µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=12                    1.00     70.8±0.37µs        ? ?/sec    1.29     91.2±1.16µs        ? ?/sec
in_list/Utf8/list=3/nulls=0%/str=3                     1.00     71.9±0.35µs        ? ?/sec    1.31     94.5±0.53µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=100                  1.00    154.2±2.13µs        ? ?/sec    1.10    169.0±5.03µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=12                   1.00    109.8±0.45µs        ? ?/sec    1.15    126.3±0.38µs        ? ?/sec
in_list/Utf8/list=3/nulls=20%/str=3                    1.00    111.6±1.74µs        ? ?/sec    1.16    129.0±0.76µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=100                   1.00    134.7±2.87µs        ? ?/sec    1.15    154.6±1.92µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=12                    1.00     75.8±1.52µs        ? ?/sec    1.30     98.4±3.00µs        ? ?/sec
in_list/Utf8/list=8/nulls=0%/str=3                     1.00    80.3±10.28µs        ? ?/sec    1.28    102.5±1.33µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=100                  1.00    157.5±1.11µs        ? ?/sec    1.11    174.1±8.37µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=12                   1.00    115.2±0.72µs        ? ?/sec    1.13    130.5±1.14µs        ? ?/sec
in_list/Utf8/list=8/nulls=20%/str=3                    1.00    115.2±1.21µs        ? ?/sec    1.20    138.2±1.54µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=0%/nulls=0%                                                 1.00    145.0±0.93µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=0%/nulls=20%                                                1.00    185.9±0.88µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=25%/nulls=0%                                                1.00    222.8±5.76µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=25%/nulls=20%                                               1.00    200.0±0.51µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=75%/nulls=0%                                                1.00    195.8±0.61µs        ? ?/sec
in_list/Utf8/mixed/list=100/match=75%/nulls=20%                                               1.00    212.3±0.86µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=0%/nulls=0%                                                  1.00    150.9±1.13µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=0%/nulls=20%                                                 1.00    201.1±3.40µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=25%/nulls=0%                                                 1.00    209.8±2.22µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=25%/nulls=20%                                                1.00    199.4±0.38µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=75%/nulls=0%                                                 1.00    179.2±0.40µs        ? ?/sec
in_list/Utf8/mixed/list=28/match=75%/nulls=20%                                                1.00   215.3±19.57µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=0%/nulls=0%                                                   1.00    125.7±2.17µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=0%/nulls=20%                                                  1.00    159.4±5.51µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=25%/nulls=0%                                                  1.00    156.7±1.19µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=25%/nulls=20%                                                 1.00    185.8±0.84µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=75%/nulls=0%                                                  1.00    176.1±5.67µs        ? ?/sec
in_list/Utf8/mixed/list=3/match=75%/nulls=20%                                                 1.00    207.7±0.77µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=0%/nulls=0%                                                   1.00    130.5±0.49µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=0%/nulls=20%                                                  1.00    167.1±2.49µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=25%/nulls=0%                                                  1.00    170.3±3.78µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=25%/nulls=20%                                                 1.00    201.0±4.91µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=75%/nulls=0%                                                  1.00    176.6±2.03µs        ? ?/sec
in_list/Utf8/mixed/list=8/match=75%/nulls=20%                                                 1.00    205.7±4.27µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=100             1.84    159.0±5.20µs        ? ?/sec    1.00     86.3±0.43µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=12              1.12     94.7±2.52µs        ? ?/sec    1.00     84.5±0.45µs        ? ?/sec
in_list/Utf8View/list=100/nulls=0%/str=3               2.31    151.9±3.47µs        ? ?/sec    1.00     65.8±0.91µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=100            2.15    182.7±1.52µs        ? ?/sec    1.00     84.8±0.83µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=12             1.94    131.2±0.56µs        ? ?/sec    1.00     67.5±1.36µs        ? ?/sec
in_list/Utf8View/list=100/nulls=20%/str=3              2.08    132.1±1.04µs        ? ?/sec    1.00     63.4±0.31µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=100              2.71    194.9±1.70µs        ? ?/sec    1.00     72.1±1.09µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=12               1.73     95.1±0.28µs        ? ?/sec    1.00     54.9±1.33µs        ? ?/sec
in_list/Utf8View/list=28/nulls=0%/str=3                1.57     82.4±0.63µs        ? ?/sec    1.00     52.3±1.28µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=100             1.87   213.0±14.99µs        ? ?/sec    1.00    114.0±1.80µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=12              1.32    120.1±0.53µs        ? ?/sec    1.00     91.1±0.76µs        ? ?/sec
in_list/Utf8View/list=28/nulls=20%/str=3               1.45    129.4±0.33µs        ? ?/sec    1.00     89.3±0.87µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=100               3.14    136.7±5.53µs        ? ?/sec    1.00     43.6±0.32µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=12                4.56     71.2±6.86µs        ? ?/sec    1.00     15.6±0.70µs        ? ?/sec
in_list/Utf8View/list=3/nulls=0%/str=3                 4.59     71.3±2.27µs        ? ?/sec    1.00     15.5±0.49µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=100              2.13    165.5±1.43µs        ? ?/sec    1.00     77.8±1.29µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=12               3.83    113.0±4.15µs        ? ?/sec    1.00     29.5±0.23µs        ? ?/sec
in_list/Utf8View/list=3/nulls=20%/str=3                3.92    116.0±0.60µs        ? ?/sec    1.00     29.6±0.31µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=100               2.81    141.0±0.86µs        ? ?/sec    1.00     50.2±0.16µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=12                1.53     74.9±0.55µs        ? ?/sec    1.00     48.8±0.26µs        ? ?/sec
in_list/Utf8View/list=8/nulls=0%/str=3                 1.58     76.9±0.33µs        ? ?/sec    1.00     48.7±0.20µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=100              2.17    170.4±3.26µs        ? ?/sec    1.00     78.7±0.29µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=12               2.04    115.6±0.53µs        ? ?/sec    1.00     56.8±0.99µs        ? ?/sec
in_list/Utf8View/list=8/nulls=20%/str=3                2.14    120.4±0.44µs        ? ?/sec    1.00     56.3±0.57µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=0%/nulls=0%                                             1.00     84.5±0.37µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=0%/nulls=20%                                            1.00    103.2±0.53µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=25%/nulls=0%                                            1.00    126.7±0.42µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=25%/nulls=20%                                           1.00    140.4±1.19µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=75%/nulls=0%                                            1.00    134.7±1.11µs        ? ?/sec
in_list/Utf8View/mixed/list=100/match=75%/nulls=20%                                           1.00    150.7±1.27µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=0%/nulls=0%                                              1.00     83.0±0.72µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=0%/nulls=20%                                             1.00    104.4±0.67µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=25%/nulls=0%                                             1.00    130.7±9.46µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=25%/nulls=20%                                            1.00    150.8±1.49µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=75%/nulls=0%                                             1.00    140.3±0.53µs        ? ?/sec
in_list/Utf8View/mixed/list=28/match=75%/nulls=20%                                            1.00    151.2±5.85µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=0%/nulls=0%                                               1.00     70.0±1.59µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=0%/nulls=20%                                              1.00     99.0±0.73µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=25%/nulls=0%                                              1.00    102.8±0.72µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=25%/nulls=20%                                             1.00    129.5±1.07µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=75%/nulls=0%                                              1.00    104.4±0.77µs        ? ?/sec
in_list/Utf8View/mixed/list=3/match=75%/nulls=20%                                             1.00    152.3±1.11µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=0%/nulls=0%                                               1.00     70.4±0.25µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=0%/nulls=20%                                              1.00    101.1±2.39µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=25%/nulls=0%                                              1.00    103.4±0.66µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=25%/nulls=20%                                             1.00    124.4±0.62µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=75%/nulls=0%                                              1.00     97.3±0.32µs        ? ?/sec
in_list/Utf8View/mixed/list=8/match=75%/nulls=20%                                             1.00    143.7±7.61µs        ? ?/sec

@adriangb

Copy link
Copy Markdown
Contributor

@adriangb Sorry for the late reply, I was off and somehow missed this notification. I agree that this change is pretty well tested and benchmarked now, so I'd be pretty surprised if it introduces major issues (we might still have some weird edge case of course, as usual.) What I'm a bit more concerned about is maintainability as it does introduce quite a bit of complex features. In particular, "Commit 7: Implement Direct Probe", while showing significant gains, is pretty tricky to understand well. I would never have come up with something like this without AI "helping" out. WDYT? Are the performance gains worth the additional future headaches when new work in this area is needed?

That is my concern as well :)

It's hard for me to judge what is complex because I've never seen it before / don't have a CS degree vs. is complex for anyone. I'm prepared to basically trust your judgment on it.

How about this test for each commit / optimization: if your team came and said "hey we are hitting an InList bug in prod, please go fix it" and you had never seen the code before, would you feel "this is complicated but the X% perf gain makes it worth it" or "my first instinct is to rip this out it's not worth it". Maybe we pick 1-2 lowest "bang for the buck" optimizations in here and stash those for later?

One thing we could do is merge as stacked PRs so that commits don't get squashed and it's easier to revert individual pieces. Ultimately if there were issues because this is self contained I think the initial answer would be to revert the problematic optimization.

@adriangbot

Copy link
Copy Markdown

🤖 Criterion benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

group                                                                main                                   perf_in_list_optims
-----                                                                ----                                   -------------------
dictionary/i32/dict=10/list=16                                       1.00      7.6±0.01µs        ? ?/sec    1.02      7.7±0.00µs        ? ?/sec
dictionary/i32/dict=100/list=16                                      1.00      7.8±0.01µs        ? ?/sec    1.00      7.8±0.01µs        ? ?/sec
dictionary/i32/dict=100/list=16/NOT_IN                               1.00      7.7±0.01µs        ? ?/sec    1.02      7.8±0.01µs        ? ?/sec
dictionary/i32/dict=100/list=4                                       1.00      7.7±0.01µs        ? ?/sec    1.00      7.7±0.00µs        ? ?/sec
dictionary/i32/dict=100/list=64                                      1.00      7.7±0.01µs        ? ?/sec    1.01      7.8±0.01µs        ? ?/sec
dictionary/i32/dict=1000/list=16                                     1.01      9.0±0.00µs        ? ?/sec    1.00      8.9±0.01µs        ? ?/sec
dictionary/utf8_long/dict=100/list=16                                1.06      8.8±0.04µs        ? ?/sec    1.00      8.3±0.01µs        ? ?/sec
dictionary/utf8_short/dict=50/list=32                                1.08      8.6±0.05µs        ? ?/sec    1.00      7.9±0.02µs        ? ?/sec
dictionary/utf8_short/dict=50/list=8                                 1.07      8.4±0.03µs        ? ?/sec    1.00      7.9±0.01µs        ? ?/sec
dictionary/utf8_short/dict=500/list=20                               1.00     10.4±0.04µs        ? ?/sec    1.02     10.6±0.03µs        ? ?/sec
f32/large_list/list=64/match=0%                                      1.93     15.1±0.01µs        ? ?/sec    1.00      7.8±0.00µs        ? ?/sec
f32/large_list/list=64/match=50%                                     2.95     27.2±0.39µs        ? ?/sec    1.00      9.2±0.00µs        ? ?/sec
f32/small_list/list=32/match=0%                                      1.01     15.3±0.01µs        ? ?/sec    1.00     15.2±0.00µs        ? ?/sec
f32/small_list/list=32/match=50%                                     1.42     21.5±0.17µs        ? ?/sec    1.00     15.2±0.01µs        ? ?/sec
f32/small_list/list=4/match=0%                                       4.45     15.4±0.03µs        ? ?/sec    1.00      3.5±0.00µs        ? ?/sec
f32/small_list/list=4/match=50%                                      7.99     27.6±0.27µs        ? ?/sec    1.00      3.5±0.00µs        ? ?/sec
fixed_size_binary/fsb16/list=10000/match=0%                          3.15     37.6±0.20µs        ? ?/sec    1.00     11.9±0.03µs        ? ?/sec
fixed_size_binary/fsb16/list=10000/match=50%                         5.17     72.8±0.36µs        ? ?/sec    1.00     14.1±0.06µs        ? ?/sec
fixed_size_binary/fsb16/list=256/match=0%                            3.39     34.9±0.05µs        ? ?/sec    1.00     10.3±0.01µs        ? ?/sec
fixed_size_binary/fsb16/list=256/match=50%                           5.93     67.0±1.51µs        ? ?/sec    1.00     11.3±0.01µs        ? ?/sec
fixed_size_binary/fsb16/list=4/match=0%                              2.86     33.0±0.04µs        ? ?/sec    1.00     11.5±0.01µs        ? ?/sec
fixed_size_binary/fsb16/list=4/match=50%                             5.83     67.3±0.30µs        ? ?/sec    1.00     11.5±0.01µs        ? ?/sec
fixed_size_binary/fsb16/list=64/match=0%                             3.20     32.9±0.03µs        ? ?/sec    1.00     10.3±0.01µs        ? ?/sec
fixed_size_binary/fsb16/list=64/match=50%                            6.03     68.8±0.26µs        ? ?/sec    1.00     11.4±0.01µs        ? ?/sec
narrow_integer/i16/list=256/match=0%                                 2.37     12.6±0.03µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=256/match=50%                                3.32     17.6±0.15µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=4/match=0%                                   2.27     12.1±0.02µs        ? ?/sec    1.00      5.3±0.01µs        ? ?/sec
narrow_integer/i16/list=4/match=50%                                  4.12     21.9±0.35µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=0%                                  2.44     13.0±0.01µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=50%                                 3.70     19.6±0.21µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/u8/list=16/match=0%                                   2.36     12.3±0.02µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec
narrow_integer/u8/list=16/match=50%                                  4.84     25.3±0.26µs        ? ?/sec    1.00      5.2±0.02µs        ? ?/sec
narrow_integer/u8/list=4/match=0%                                    2.33     12.2±0.04µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec
narrow_integer/u8/list=4/match=50%                                   4.89     25.4±0.40µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
nulls/narrow_integer/u8/list=16/match=50%/nulls=20%                  4.84     25.5±0.12µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
nulls/primitive/i32/large_list/list=64/match=50%/nulls=20%           2.23     21.1±0.14µs        ? ?/sec    1.00      9.5±0.01µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=20%           1.85     18.5±0.12µs        ? ?/sec    1.00     10.0±0.01µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=20%/NOT_IN    2.20     22.0±0.41µs        ? ?/sec    1.00     10.0±0.01µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=50%           1.66     16.5±0.10µs        ? ?/sec    1.00      9.9±0.01µs        ? ?/sec
nulls/utf8/long_24b/list=16/match=50%/nulls=20%                      1.15     82.0±0.38µs        ? ?/sec    1.00     71.4±0.37µs        ? ?/sec
nulls/utf8/short_8b/list=16/match=50%/nulls=20%                      1.42     69.6±0.24µs        ? ?/sec    1.00     48.9±0.06µs        ? ?/sec
nulls/utf8view/long_24b/list=16/match=50%/nulls=20%                  1.00     98.7±0.37µs        ? ?/sec    1.00     99.0±0.25µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=20%                  6.06     70.5±0.50µs        ? ?/sec    1.00     11.6±0.01µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=20%/NOT_IN           6.03     70.5±0.44µs        ? ?/sec    1.00     11.7±0.01µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=50%                  5.66     70.1±0.45µs        ? ?/sec    1.00     12.4±0.00µs        ? ?/sec
primitive/i32/large_list/list=256/match=0%                           1.65     12.9±0.01µs        ? ?/sec    1.00      7.8±0.00µs        ? ?/sec
primitive/i32/large_list/list=256/match=50%                          2.57     22.9±0.24µs        ? ?/sec    1.00      8.9±0.01µs        ? ?/sec
primitive/i32/large_list/list=64/match=0%                            1.54     12.1±0.02µs        ? ?/sec    1.00      7.9±0.01µs        ? ?/sec
primitive/i32/large_list/list=64/match=50%                           1.84     17.0±0.17µs        ? ?/sec    1.00      9.2±0.01µs        ? ?/sec
primitive/i32/small_list/list=16/match=50%/NOT_IN                    2.17     21.5±0.23µs        ? ?/sec    1.00      9.9±0.00µs        ? ?/sec
primitive/i32/small_list/list=32/match=0%                            1.00     12.2±0.01µs        ? ?/sec    1.24     15.2±0.00µs        ? ?/sec
primitive/i32/small_list/list=32/match=50%                           1.24     18.9±0.20µs        ? ?/sec    1.00     15.2±0.01µs        ? ?/sec
primitive/i32/small_list/list=4/match=0%                             3.62     12.5±0.12µs        ? ?/sec    1.00      3.5±0.00µs        ? ?/sec
primitive/i32/small_list/list=4/match=50%                            6.89     23.9±0.29µs        ? ?/sec    1.00      3.5±0.00µs        ? ?/sec
primitive/i64/large_list/list=128/match=0%                           1.55     12.0±0.05µs        ? ?/sec    1.00      7.8±0.01µs        ? ?/sec
primitive/i64/large_list/list=128/match=50%                          2.07     19.4±0.11µs        ? ?/sec    1.00      9.4±0.01µs        ? ?/sec
primitive/i64/large_list/list=32/match=0%                            1.43     11.9±0.01µs        ? ?/sec    1.00      8.3±0.01µs        ? ?/sec
primitive/i64/large_list/list=32/match=50%                           1.82     19.2±0.14µs        ? ?/sec    1.00     10.5±0.01µs        ? ?/sec
primitive/i64/small_list/list=16/match=0%                            1.00     12.2±0.09µs        ? ?/sec    1.30     15.9±0.01µs        ? ?/sec
primitive/i64/small_list/list=16/match=50%                           1.21     19.2±0.09µs        ? ?/sec    1.00     15.9±0.01µs        ? ?/sec
primitive/i64/small_list/list=4/match=0%                             2.79     12.0±0.01µs        ? ?/sec    1.00      4.3±0.01µs        ? ?/sec
primitive/i64/small_list/list=4/match=50%                            5.64     24.4±0.43µs        ? ?/sec    1.00      4.3±0.01µs        ? ?/sec
timestamp_ns/large_list/list=32/match=0%                             3.00     24.7±0.02µs        ? ?/sec    1.00      8.2±0.01µs        ? ?/sec
timestamp_ns/large_list/list=32/match=50%                            5.19     48.2±0.69µs        ? ?/sec    1.00      9.3±0.01µs        ? ?/sec
timestamp_ns/small_list/list=16/match=0%                             1.56     24.9±0.02µs        ? ?/sec    1.00     15.9±0.02µs        ? ?/sec
timestamp_ns/small_list/list=16/match=50%                            3.15     50.3±0.90µs        ? ?/sec    1.00     16.0±0.01µs        ? ?/sec
timestamp_ns/small_list/list=4/match=0%                              5.82     25.1±0.03µs        ? ?/sec    1.00      4.3±0.01µs        ? ?/sec
timestamp_ns/small_list/list=4/match=50%                             9.86     42.8±2.22µs        ? ?/sec    1.00      4.3±0.01µs        ? ?/sec
utf8/long_24b/list=256/match=0%                                      1.21     41.5±0.03µs        ? ?/sec    1.00     34.4±0.02µs        ? ?/sec
utf8/long_24b/list=256/match=50%                                     1.13     81.7±0.58µs        ? ?/sec    1.00     72.5±0.52µs        ? ?/sec
utf8/long_24b/list=4/match=0%                                        1.18     41.5±0.05µs        ? ?/sec    1.00     35.1±0.23µs        ? ?/sec
utf8/long_24b/list=4/match=50%                                       1.11     82.5±0.26µs        ? ?/sec    1.00     74.4±0.42µs        ? ?/sec
utf8/long_24b/list=64/match=0%                                       1.20     41.2±0.03µs        ? ?/sec    1.00     34.2±0.03µs        ? ?/sec
utf8/long_24b/list=64/match=50%                                      1.10     81.3±0.33µs        ? ?/sec    1.00     74.0±0.46µs        ? ?/sec
utf8/mixed_len/list=16/match=0%                                      1.23     42.9±0.15µs        ? ?/sec    1.00     34.9±0.20µs        ? ?/sec
utf8/mixed_len/list=16/match=50%                                     1.22    115.8±0.89µs        ? ?/sec    1.00     95.2±0.74µs        ? ?/sec
utf8/mixed_len/list=64/match=0%                                      1.14     43.1±0.12µs        ? ?/sec    1.00     37.8±0.09µs        ? ?/sec
utf8/mixed_len/list=64/match=50%                                     1.18    121.0±0.57µs        ? ?/sec    1.00    102.9±0.70µs        ? ?/sec
utf8/shared_prefix/pfx=12/list=32/match=50%                          1.09     80.6±0.28µs        ? ?/sec    1.00     73.8±0.56µs        ? ?/sec
utf8/short_8b/list=16/match=50%/NOT_IN                               1.45     72.1±0.47µs        ? ?/sec    1.00     49.6±0.05µs        ? ?/sec
utf8/short_8b/list=256/match=0%                                      1.00     34.1±0.02µs        ? ?/sec    1.43     48.8±0.03µs        ? ?/sec
utf8/short_8b/list=256/match=50%                                     1.48     73.8±0.40µs        ? ?/sec    1.00     49.9±0.05µs        ? ?/sec
utf8/short_8b/list=4/match=0%                                        1.00     34.2±0.03µs        ? ?/sec    1.41     48.1±0.05µs        ? ?/sec
utf8/short_8b/list=4/match=50%                                       1.46     71.2±0.31µs        ? ?/sec    1.00     48.9±0.05µs        ? ?/sec
utf8/short_8b/list=64/match=0%                                       1.00     34.0±0.03µs        ? ?/sec    1.44     49.0±0.03µs        ? ?/sec
utf8/short_8b/list=64/match=50%                                      1.49     74.9±0.57µs        ? ?/sec    1.00     50.1±0.05µs        ? ?/sec
utf8view/len_12b/list=16/match=0%                                    2.51     26.0±0.02µs        ? ?/sec    1.00     10.4±0.01µs        ? ?/sec
utf8view/len_12b/list=16/match=50%                                   4.52     50.8±0.33µs        ? ?/sec    1.00     11.2±0.01µs        ? ?/sec
utf8view/len_12b/list=64/match=0%                                    2.59     25.9±0.02µs        ? ?/sec    1.00     10.0±0.01µs        ? ?/sec
utf8view/len_12b/list=64/match=50%                                   4.52     50.1±0.38µs        ? ?/sec    1.00     11.1±0.01µs        ? ?/sec
utf8view/long_24b/list=16/match=0%                                   3.61     47.9±0.05µs        ? ?/sec    1.00     13.2±0.01µs        ? ?/sec
utf8view/long_24b/list=16/match=50%                                  1.11     94.3±0.79µs        ? ?/sec    1.00     84.8±0.41µs        ? ?/sec
utf8view/long_24b/list=256/match=0%                                  2.71     47.4±0.03µs        ? ?/sec    1.00     17.5±0.04µs        ? ?/sec
utf8view/long_24b/list=256/match=50%                                 1.00     92.4±0.28µs        ? ?/sec    1.00     92.9±0.21µs        ? ?/sec
utf8view/long_24b/list=4/match=0%                                    3.94     47.8±0.03µs        ? ?/sec    1.00     12.1±0.02µs        ? ?/sec
utf8view/long_24b/list=4/match=50%                                   1.08     93.7±0.78µs        ? ?/sec    1.00     86.6±0.27µs        ? ?/sec
utf8view/long_24b/list=64/match=0%                                   2.56     47.4±0.05µs        ? ?/sec    1.00     18.5±0.01µs        ? ?/sec
utf8view/long_24b/list=64/match=50%                                  1.00     93.2±0.82µs        ? ?/sec    1.00     93.5±0.33µs        ? ?/sec
utf8view/mixed_len/list=16/match=0%                                  2.81     35.9±0.03µs        ? ?/sec    1.00     12.8±0.01µs        ? ?/sec
utf8view/mixed_len/list=16/match=50%                                 3.03     98.6±0.62µs        ? ?/sec    1.00     32.6±0.04µs        ? ?/sec
utf8view/mixed_len/list=64/match=0%                                  2.82     35.9±0.08µs        ? ?/sec    1.00     12.7±0.02µs        ? ?/sec
utf8view/mixed_len/list=64/match=50%                                 2.32    111.4±0.48µs        ? ?/sec    1.00     48.1±0.15µs        ? ?/sec
utf8view/shared_prefix/pfx=12/list=32/match=0%                       4.93     51.2±0.12µs        ? ?/sec    1.00     10.4±0.02µs        ? ?/sec
utf8view/shared_prefix/pfx=12/list=32/match=50%                      1.12     92.0±0.30µs        ? ?/sec    1.00     81.9±0.19µs        ? ?/sec
utf8view/shared_prefix/pfx=16/list=64/match=0%                       4.59     47.7±0.06µs        ? ?/sec    1.00     10.4±0.01µs        ? ?/sec
utf8view/shared_prefix/pfx=16/list=64/match=50%                      1.13     93.4±0.42µs        ? ?/sec    1.00     82.9±0.14µs        ? ?/sec
utf8view/shared_prefix/pfx=8/list=16/match=0%                        3.61     37.6±0.04µs        ? ?/sec    1.00     10.4±0.02µs        ? ?/sec
utf8view/shared_prefix/pfx=8/list=16/match=50%                       1.22     81.7±0.25µs        ? ?/sec    1.00     67.0±0.22µs        ? ?/sec
utf8view/short_8b/list=16/match=0%                                   2.51     25.5±0.09µs        ? ?/sec    1.00     10.2±0.01µs        ? ?/sec
utf8view/short_8b/list=16/match=50%                                  4.52     49.8±0.30µs        ? ?/sec    1.00     11.0±0.00µs        ? ?/sec
utf8view/short_8b/list=256/match=0%                                  2.53     25.5±0.02µs        ? ?/sec    1.00     10.0±0.02µs        ? ?/sec
utf8view/short_8b/list=256/match=50%                                 4.57     50.6±0.39µs        ? ?/sec    1.00     11.1±0.00µs        ? ?/sec
utf8view/short_8b/list=4/match=0%                                    2.26     25.8±0.05µs        ? ?/sec    1.00     11.4±0.00µs        ? ?/sec
utf8view/short_8b/list=4/match=50%                                   4.37     50.0±0.41µs        ? ?/sec    1.00     11.4±0.01µs        ? ?/sec
utf8view/short_8b/list=64/match=0%                                   2.41     25.4±0.03µs        ? ?/sec    1.00     10.5±0.00µs        ? ?/sec
utf8view/short_8b/list=64/match=50%                                  4.28     49.8±0.17µs        ? ?/sec    1.00     11.6±0.01µs        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 1085.2s
Peak memory 4.6 GiB
Avg memory 4.6 GiB
CPU user 1382.6s
CPU sys 1.9s
Peak spill 0 B

branch

Metric Value
Wall time 1135.2s
Peak memory 4.6 GiB
Avg memory 4.6 GiB
CPU user 1437.6s
CPU sys 1.3s
Peak spill 0 B

File an issue against this benchmark runner

@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

@adriangb Sorry for the late reply, I was off and somehow missed this notification. I agree that this change is pretty well tested and benchmarked now, so I'd be pretty surprised if it introduces major issues (we might still have some weird edge case of course, as usual.) What I'm a bit more concerned about is maintainability as it does introduce quite a bit of complex features. In particular, "Commit 7: Implement Direct Probe", while showing significant gains, is pretty tricky to understand well. I would never have come up with something like this without AI "helping" out. WDYT? Are the performance gains worth the additional future headaches when new work in this area is needed?

That is my concern as well :)

It's hard for me to judge what is complex because I've never seen it before / don't have a CS degree vs. is complex for anyone. I'm prepared to basically trust your judgment on it.

How about this test for each commit / optimization: if your team came and said "hey we are hitting an InList bug in prod, please go fix it" and you had never seen the code before, would you feel "this is complicated but the X% perf gain makes it worth it" or "my first instinct is to rip this out it's not worth it". Maybe we pick 1-2 lowest "bang for the buck" optimizations in here and stash those for later?

One thing we could do is merge as stacked PRs so that commits don't get squashed and it's easier to revert individual pieces. Ultimately if there were issues because this is self contained I think the initial answer would be to revert the problematic optimization.

@adriangb Good idea, stacked PRs is probably the safest bet here. We don't want all commits to get squashed into a single one (is that the merge policy on datafusion?), impossible to revert out of selectively. With stacked PRs, each optimization gets its own dedicated PR/commit, easy to revert and git bisect in case of issue (manually or with coding agents.)
The most complex commit I mentioned above does have some pretty significant gains, so it would be a shame to not take advantage of it! I'll work on stacking these properly (but maybe we can skip the in-depth review of each and focus on the big picture here.)

@adriangb

Copy link
Copy Markdown
Contributor

is that the merge policy on datafusion?

I believe so. We only have 1 merge button and afaik it squashes.

maybe we can skip the in-depth review of each and focus on the big picture here

Yep agreed. I think if benchmarks look good, all tests pass and there are no public API changes we can move forward with them.

@alamb

alamb commented May 27, 2026

Copy link
Copy Markdown
Contributor

Thsoe are some pretty sweet performance results. I will try and find some time to review this more carefully

@alamb alamb changed the title IN LIST optims Optimize IN performance with specialized implementations May 27, 2026
Replaces HashSet<u8> with a 32-byte stack-allocated bitmap. Provides O(1) membership testing via bit-shifting, significantly reducing memory overhead and improving cache locality. Triggers for UInt8 arrays.
Implements an 8 KB heap-allocated bitmap for UInt16. Maintains O(1) performance while handling the larger value space. Triggers for UInt16 arrays.
Introduces zero-copy buffer reinterpretation to allow signed integers and other 1 or 2-byte primitive types (e.g. Float16) to use the high-performance bitmap filters. Triggers for all types with 1-byte or 2-byte width.
Adds a const-generic unrolled comparison chain that avoids CPU branching. Outperforms hash lookups for very small lists. Triggers for primitives when list size <= 32 (4-byte), 16 (8-byte), or 4 (16-byte).
Implements a fast hash table using open addressing with linear probing and a 25% load factor. Replaces the legacy HashSet for primitives, reducing indirection. Triggers for primitives when list size exceeds branchless thresholds.
Introduces a two-stage filter for ByteView types. Stage 1 uses a fast DirectProbeFilter on masked views (len + prefix) for quick rejection; Stage 2 performs full verification only for potential long-string matches. Triggers for Utf8View and BinaryView.
Port of the two-stage View optimization to standard Utf8 and LargeUtf8 types. Encodes strings as i128 (len + prefix) for fast O(1) pre-filtering before falling back to full string comparison. Triggers for Utf8 and LargeUtf8.
FixedSizeBinary(N) arrays share the same contiguous buffer layout as primitive arrays, so for power-of-2 widths (1, 2, 4, 8, 16) we can zero-copy reinterpret them and use the optimized primitive filters (bitmap, branchless, hash) instead of falling through to the NestedTypeFilter fallback.
@geoffreyclaude

Copy link
Copy Markdown
Contributor Author

Closing this aggregate PR now that the work has been split into the stacked review series:

  1. IN LIST: clean up generic static filtering #21927: generic static-filter cleanup and fallback optimization
  2. IN LIST: add UInt8 bitmap filter #23011: Bitmap filter for UInt8
  3. IN LIST: add UInt16 bitmap filter #23012: Bitmap filter for UInt16
  4. IN LIST: reinterpret small-width types for bitmap filters #23013: zero-copy reinterpretation for 1-byte and 2-byte bitmap paths
  5. IN LIST: add branchless filter for small primitive lists #23014: branchless filter for small primitive lists
  6. IN LIST: add direct-probe hash filter for large primitive lists #23015: direct-probe hash filter for large primitive lists
  7. IN LIST: add string-view filters for Utf8View and BinaryView #23016: string-view filters for Utf8View and BinaryView
  8. IN LIST: add two-stage filter for Utf8 and LargeUtf8 #23017: two-stage filter for legacy Utf8 and LargeUtf8
  9. IN LIST: reinterpret FixedSizeBinary for primitive fast paths #23018: zero-copy reinterpretation for FixedSizeBinary

#19241 remains the umbrella issue for the overall IN LIST performance work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Make DataFusion faster physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants