-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix performance for Bcmath numbers with trailing zeros #11641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
jorgsowa
wants to merge
24
commits into
php:master
from
jorgsowa:bcmath-fix-performance-for-numbers-with-trailing-zeros
Closed
Fix performance for Bcmath numbers with trailing zeros #11641
jorgsowa
wants to merge
24
commits into
php:master
from
jorgsowa:bcmath-fix-performance-for-numbers-with-trailing-zeros
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can you rebase this now that the refactoring PR has landed |
94cfed7
to
d63ba2f
Compare
There still seems to be a conflict, I think you forgot to pull the lastest changes from master |
The typo in HAVE_PTHREAD_ATTR_GET_STACK (might be due to pthread_attr_get_np being different from Linux's pthread_getattr_np) led to this code path never get called on FreeBSD.
x8 being already reserved, we can only pull x18 to x27.
Fixes OSS Fuzz #60735
The normal xmlSetProp() function parses the name to find the namespace. But we don't care about the namespace in this case.
These checks will always be false because we're dealing with elements here. DOMElement always are of type XML_ELEMENT_NODE, so they don't need to be checked.
dom_get_doc_props_read_only() already does a NULL check.
* ext/bcmath: coding style: use indentation And add braces to block statements, as the current code was pretty much unreadable with how inconsistent it was. * ext/bcmath: Remove some useless header inclusions * ext/bcmath: Use standard C99 bool type instead of char * ext/bcmath: Include specific headers instead of config.h * Restructure definitions to reduce header inclusions * Use size_t as a more appropriate type * Remove unused variable full_scale * Refactor bc_raisemod() to get rid of Zend dependencies This separates the concerns of throwing exceptions back into the PHP_FUNCTION instead of being the responsibility of the library * Refactor bc_raise() to get rid of Zend dependencies This separates the concerns of throwing exceptions back into the PHP_FUNCTION instead of being the responsibility of the library * Refactor bc_divmod() and bc_modulo() to return bool Return false on division by 0 attempt instead of -1 and true on success instead of 0 * Refactor bc_divide() to return bool Return false on division by 0 attempt instead of -1 and true on success instead of 0
- publicId could crash PHP if none was provided - notationName never worked The fields of this classs were untested. This new test file changes that. Closes phpGH-11779.
Previously, when replacing the node with itself (or contained within itself), the node disappeared. Closes phpGH-11770.
Fixes oss-fuzz #60741 Closes phpGH-11780
…Immutable objects
I messed up with rebasing. Sorry. Will create new PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR improves the performance of the BC extension computations for the decimal numbers with trailing zeros. Specifically we get Memory limit error while we want to raise zero with many trailing zeros to large exponent. Example: https://onlinephp.io/c/dcd86
Also it may improve other special cases of the math operations with number zero, like multiplying with number zero.
Changes made: