Skip to content

perf: Optimize NULL handling in arrays_zip#21475

Open
neilconway wants to merge 2 commits intoapache:mainfrom
neilconway:neilc/perf-arrays-zip-nulls
Open

perf: Optimize NULL handling in arrays_zip#21475
neilconway wants to merge 2 commits intoapache:mainfrom
neilconway:neilc/perf-arrays-zip-nulls

Conversation

@neilconway
Copy link
Copy Markdown
Contributor

@neilconway neilconway commented Apr 8, 2026

Which issue does this PR close?

Rationale for this change

arrays_zip was building a Vec<bool> and then converting it to a NullBuffer. It is simpler and (a bit) faster to just use NullBuffer / NullBufferBuilder directly.

Benchmarks (ARM64):

  - arrays_zip_no_nulls_8192: 1096.5µs → 1010.7µs, -7.8%
  - arrays_zip_10pct_nulls_8192: 1131.8µs → 1100.1µs, -2.8%

The improvement is not massive but it's non-zero, and the resulting code is cleaner and more idiomatic.

What changes are included in this PR?

  • Implement optimization
  • Add benchmark

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the functions Changes to functions implementation label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize NULL handling in arrays_zip

1 participant