Skip to content

perf: optimize next_day in datafusion-comet-spark-expr#4899

Draft
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/next_day-datafusion-comet-20260712-084631
Draft

perf: optimize next_day in datafusion-comet-spark-expr#4899
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/next_day-datafusion-comet-20260712-084631

Conversation

@andygrove

Copy link
Copy Markdown
Member

This PR was created by an LLM as a draft PR. I will mark it as ready for review after human review.

Which issue does this PR close?

N/A — autonomous exploratory PR.

Rationale for this change

Replace the per-row to_uppercase() heap allocation in day-of-week parsing with an allocation-free ASCII stack-buffer fast path (Unicode to_uppercase fallback only for non-ASCII), avoiding one allocation per row.

What changes are included in this PR?

Replace the per-row to_uppercase() heap allocation in day-of-week parsing with an allocation-free ASCII stack-buffer fast path (Unicode to_uppercase fallback only for non-ASCII), avoiding one allocation per row.

How are these changes tested?

Correctness: unit tests + seeded differential fuzz (bit-identical Arrow output vs main).

Benchmark (criterion):

  • next_day_ scalar day-of-week: 19.459% faster (base 209122ns -> cand 168429ns)
  • next_day_ array day-of-week: 28.982% faster (base 200938ns -> cand 142701ns)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant