8229845: Decrease memory consumption of BigInteger.toString()

Brian Burkhalter brian.burkhalter at oracle.com
Tue Aug 20 23:31:26 UTC 2019

Hi Ivan,

> On Aug 20, 2019, at 2:45 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
> Would it make sense to add an argument `digits` to smallToString (like the same named argument of toString, the minimum number of digits to pad to), so it could zero-pad the result itself?
> This way we could avoid inserting zeros into the middle of a StringBuilder after a call to smallToString.

Indeed I do not like the zero insertion either. I’ll investigate your idea.



> On 8/20/19 11:51 AM, Brian Burkhalter wrote:
>> Delta [1] and revised [2] patches:
>> [1] http://cr.openjdk.java.net/~bpb/8229845/webrev.00-01/ <http://cr.openjdk.java.net/~bpb/8229845/webrev.00-01/>
>> [2] http://cr.openjdk.java.net/~bpb/8229845/webrev.01/ <http://cr.openjdk.java.net/~bpb/8229845/webrev.01/>

More information about the core-libs-dev mailing list