Skip to content

perf: optimize spark_log in datafusion-comet-spark-expr#4896

Draft
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/spark_log-datafusion-comet-20260711-104248
Draft

perf: optimize spark_log in datafusion-comet-spark-expr#4896
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/spark_log-datafusion-comet-20260711-104248

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

Hoist the constant operand's ln() out of the per-element loop in the scalar-base and scalar-value paths, removing one transcendental ln() call per row while preserving exact null/NaN semantics.

What changes are included in this PR?

Hoist the constant operand's ln() out of the per-element loop in the scalar-base and scalar-value paths, removing one transcendental ln() call per row while preserving exact null/NaN semantics.

How are these changes tested?

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

Benchmark (criterion):

  • spark_log_ array base, scalar value: 29.349% faster (base 48865ns -> cand 34524ns)
  • spark_log_ scalar base, array value: 29.341% faster (base 48927ns -> cand 34571ns)

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