Skip to content

Conversation

@jorgsowa
Copy link
Contributor

@jorgsowa jorgsowa commented Aug 17, 2023

This PR improves the performance of the BCMath function bcpow.

We don't need to perform usual multiplication when we square them. I implemented faster version of multiplication of the same number.

Approach with the function bc_square is faster about 3,4% in one of my benchmarks when I run bcpow of 10000 numbers with the exponent of 16. I suppose for bigger numbers it's more meaningful change.

fix squaring for small numbers

Fix the function bc_quare

Improve indentation
@jorgsowa
Copy link
Contributor Author

I'm closing this PR as I don't intend to make any new changes to this extension.

@jorgsowa jorgsowa closed this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant