ext/bcmath: If size of BC_VECTOR
array is within 64 bytes, stack area is now used
#18065
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Benchmark
Multiplication
Codes
1 (Has no effect since this code using the fast path):
2 (Affected by this change):
3 (Does not use stack):
Results
Example 1 is not affected by this change, so there is no speed change. A positive effect can be seen in example 2, where the requested size is very close to
64 bytes
.I thought that Example 3, which does not use a stack, would be slower due to the increased number of branches, but there was almost no change and the impact seems to be negligible.
1:
2:
3:
Divide
Codes
1 (Affected by this change (with fast path)):
2 (Affected by this change (with standard path)):
3 (Does not use stack):
Results
Examples 1 and 2 are affected by this change and show a positive effect.
Example 3, which doesn't use the stack, is also somehow faster...
1:
2:
3: