On Wed, 28 Jun 2023 22:19:04 GMT, 温绍锦 wrote:
>> Speed up Integer.toString with a precomputed cache array of length 1000, use
>> division by 1000, so that each iteration can calculate three digits.
>>
>> this optimization can also be used in StringBuilder#appent(int) and
>> Long#toString.
>>
On Wed, 28 Jun 2023 22:19:04 GMT, 温绍锦 wrote:
>> Speed up Integer.toString with a precomputed cache array of length 1000, use
>> division by 1000, so that each iteration can calculate three digits.
>>
>> this optimization can also be used in StringBuilder#appent(int) and
>> Long#toString.
>>
On Wed, 28 Jun 2023 22:19:04 GMT, 温绍锦 wrote:
>> Speed up Integer.toString with a precomputed cache array of length 1000, use
>> division by 1000, so that each iteration can calculate three digits.
>>
>> this optimization can also be used in StringBuilder#appent(int) and
>> Long#toString.
>>
On Wed, 28 Jun 2023 17:53:04 GMT, Raffaello Giulietti
wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> postpone the division
>
> src/java.base/share/classes/java/lang/Integer.java line 478:
>
>> 476:
>> 477: byte[
> Speed up Integer.toString with a precomputed cache array of length 1000, use
> division by 1000, so that each iteration can calculate three digits.
>
> this optimization can also be used in StringBuilder#appent(int) and
> Long#toString.
>
> # Benchmark Result
>
>
> make test TEST="micro:j