-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8355719: Reduce memory consumption of BigInteger.pow() #24690
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
Closed
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
98a5b53
Add nthRoot(int) methods and optimize pow(int)
fabioromano1 926970e
Merge branch 'openjdk:master' into BigInteger-nth-root
fabioromano1 a3f1489
Remove trailing whitespaces
fabioromano1 d280c37
Correct loop recurrence according to proof of convergence
fabioromano1 91c3d1a
Correct initial estimate of nth root for BigIntegers
fabioromano1 1cfb775
Removed trailing whitespace
fabioromano1 c25bd32
Avoid an overflow in computing nth root estimate
fabioromano1 9c32ce4
Merge branch 'BigInteger-nth-root' of https://github.com/fabioromano1…
fabioromano1 7ff919b
optimize division in loop iteration of nth root
fabioromano1 1f5a9b4
An optimization
fabioromano1 b6c3320
Format code
fabioromano1 5d971fa
Correct left shift if shift is zero
fabioromano1 e459c23
Memory usage optimization
fabioromano1 48650de
An optimization
fabioromano1 54ec8f8
BigIntegers nth root's initial estimate optimization
fabioromano1 3ea5190
Extend use cases of MutableBigInteger.valueOf(double)
fabioromano1 6c9b364
An optimization
fabioromano1 3ca7d29
An optimization
fabioromano1 4516d88
Format code
fabioromano1 b427091
Format code
fabioromano1 524f195
Merge branch 'openjdk:master' into BigInteger-nth-root
fabioromano1 21fbf27
Code simplification
fabioromano1 e11b32f
Added reference for proof of convergence in the comment
fabioromano1 b527fa2
Revert format code changes
fabioromano1 8de6b82
Merge branch 'BigInteger-nth-root' of https://github.com/fabioromano1…
fabioromano1 00365c9
Merge branch 'BigInteger-nth-root' of https://github.com/fabioromano1…
fabioromano1 100d0e1
Merge remote-tracking branch 'origin/BigInteger-nth-root' into BigInt…
fabioromano1 1942fd1
Suggested change
fabioromano1 0e1a99e
Delete useless folder
fabioromano1 9cd136c
Optimized computation of nth root's remainder
fabioromano1 c3bd1b2
Format code
fabioromano1 f0d0605
An optimization
fabioromano1 f20d19b
Optimized BigInteger.pow(int) for single-word values
fabioromano1 8676af7
Optimized repeated squaring trick using cache for powers
fabioromano1 3cf820b
Some optimizations
fabioromano1 23914e8
Systematization of special cases in BigInteger.pow(int)
fabioromano1 bf099e4
Optimized nth root iteration loop
fabioromano1 f9bfd22
Merge branch 'openjdk:master' into BigInteger-nth-root
fabioromano1 7ceae87
Moved nth-root implementation to a dependent PR
fabioromano1 cb61ddc
Removed method used by nth-root
fabioromano1 10e122e
Put power's computation in a stand-alone method
fabioromano1 b94ca7e
Optimized BigInteger.pow(int) to support unsigned long bases
fabioromano1 139735d
Use BigInteger(long, int) constructor
fabioromano1 fcd5d55
Throw away unsignedIntPow(int, int)
fabioromano1 b831d01
Pre-cache the powers of x up to x^3 to simplify the code
fabioromano1 51272bc
Added tests for memory consumption
fabioromano1 70da95c
Decrease exponents in tests
fabioromano1 d85a634
Update test parameters
fabioromano1 9a5d696
Removed needless condition
fabioromano1 6033d25
Don't exclude a priori valid results
fabioromano1 5deb21a
Take into account special case exponent == 1
fabioromano1 280859b
Use a more loose formula to do range check
fabioromano1 925806b
Adjust the type of operand
fabioromano1 ad49b56
Use a more accurate formula to detect certain overflows
fabioromano1 6895926
Simplified the formula for detecting overflows
fabioromano1 b8ca4fe
Simplify long power computing
fabioromano1 4103e49
Suggested changes
fabioromano1 5ebc16b
Removed needless brackets
fabioromano1 e0816d5
Code simplification
fabioromano1 009937b
Suggested changes
fabioromano1 2e08f77
Suggested changes
fabioromano1 261dd31
Code simplification
fabioromano1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.