Skip to content

perf: optimize lcm#23482

Draft
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/lcm-datafusion-20260711-085008
Draft

perf: optimize lcm#23482
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:auto-opt/lcm-datafusion-20260711-085008

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 function.

What changes are included in this PR?

lcm now computes its internal GCD with the binary (Stein's) algorithm (unsigned_gcd) instead of the division-based Euclidean gcd_helper, replacing per-iteration integer division with shifts for identical results.

Are these changes tested?

Existing tests.

Benchmark (criterion):

  • lcm both array: 25.28% faster (base 1567271ns -> cand 1171061ns)

Are there any user-facing changes?

@github-actions github-actions Bot added the functions Changes to functions implementation label Jul 11, 2026
@andygrove andygrove changed the title perf: optimize lcm in datafusion-functions perf: optimize lcm Jul 11, 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.

1 participant