Skip to content

math.big: optimize subtract_digit_array()#25142

Merged
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:sub_faster
Aug 20, 2025
Merged

math.big: optimize subtract_digit_array()#25142
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:sub_faster

Conversation

@tankf33der

@tankf33der tankf33der commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

Patch contains two parts:

  1. added return for earlier exit if second input value is zero
  2. attempt to remove 4 if statements plus two comparisons from the subtraction operation - the code became more linear and simple

Patch passed multi-million loop against gmplib.

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23678

@spytheman spytheman merged commit b3073b9 into vlang:master Aug 20, 2025
79 checks passed
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