Skip to content

docs: add scalar expression optimization guide, skill, and performance audits - #4933

Merged
andygrove merged 4 commits into
apache:mainfrom
andygrove:docs-optimize-expression-skill
Jul 15, 2026
Merged

docs: add scalar expression optimization guide, skill, and performance audits#4933
andygrove merged 4 commits into
apache:mainfrom
andygrove:docs-optimize-expression-skill

Conversation

@andygrove

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

Rationale for this change

Comet has accumulated a campaign of scalar expression performance optimizations (for example spark_cast_int_to_int, to_json, parse_url, spark_size, spark_unhex, and many more in flight). The recurring methodology and pitfalls have lived only in individual PR descriptions. This PR captures that knowledge in one place so both human contributors and automated agents follow the same approach, and so we can track which expressions have already been tuned.

What changes are included in this PR?

  • New contributor guide page Optimizing Scalar Expressions (added to the Debugging and Performance section) covering the benchmark-first workflow, criterion benchmark shapes that expose regressions, a catalog of proven techniques mapped to the PRs that landed them, correctness rules (bit-identical output, null-slot error handling, eval-mode semantics), and the no-regression gate.
  • New optimize-comet-expression skill that points at the guide as the shared source of truth and adds the agent execution loop and submission gate.
  • Extended the per-expression audit pages to record performance audits alongside correctness audits, with a dated Performance (tuned ...) line naming the technique, speedup, PR, and benchmark file.
  • Backfilled performance audit entries for the recently merged cast (int-to-int), to_json, parse_url, size, and unhex optimizations.

How are these changes tested?

Documentation and skill content only; no code changes. Verified the new page is wired into the contributor guide toctree and that the audit entries land under the correct expression headings.

@andygrove
andygrove marked this pull request as ready for review July 15, 2026 13:51
…e audits

Add a contributor guide page documenting how to optimize native scalar
expressions in datafusion-comet-spark-expr: benchmark-first workflow,
criterion benchmark shapes, a catalog of proven techniques, correctness
rules, and the no-regression gate. Add a matching optimize-comet-expression
skill that points at the guide as the shared source of truth.

Extend the per-expression audit pages to record performance audits alongside
correctness audits, and backfill entries for the recently tuned cast, to_json,
parse_url, size, and unhex expressions.
@andygrove
andygrove force-pushed the docs-optimize-expression-skill branch from 1898168 to 1d0a083 Compare July 15, 2026 13:51

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andygrove lets give it a try

@comphead

Copy link
Copy Markdown
Contributor

Please run formatter

@andygrove
andygrove merged commit 02170ec into apache:main Jul 15, 2026
16 checks passed
@andygrove
andygrove deleted the docs-optimize-expression-skill branch July 15, 2026 16:43
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.

2 participants