Skip to content

perf: optimize make_date in datafusion-functions#23470

Open
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/make_date-datafusion-20260710-180938
Open

perf: optimize make_date in datafusion-functions#23470
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/make_date-datafusion-20260710-180938

Conversation

@andygrove

@andygrove andygrove commented Jul 11, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

Rationale for this change

Optimize existing expression.

What changes are included in this PR?

Replaced make_date's per-element triple is_null check + PrimitiveBuilder with a single unioned NullBuffer, raw value-slice reads, and direct PrimitiveArray::new construction (matching the already-optimized make_time), cutting per-row overhead on the hot valid-input path.

Are these changes tested?

Existing tests + new tests.

Benchmark (criterion):

  • make_date_scalar_col_col_8192: 19.979% faster (base 31210ns -> cand 24974ns)
  • make_date_col_col_col_8192: 16.931% faster (base 30849ns -> cand 25626ns)
  • make_date_scalar_scalar_col_8192: 22.999% faster (base 31551ns -> cand 24295ns)
  • make_date_scalar_scalar_scalar: 1.271% faster (base 48ns -> cand 48ns)

Are there any user-facing changes?

No

@github-actions github-actions Bot added the functions Changes to functions implementation label Jul 11, 2026
@andygrove andygrove marked this pull request as ready for review July 11, 2026 00:56
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.

2 participants