On Wed, 6 Sep 2023 22:22:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 22:22:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 22:22:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 22:22:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 22:22:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 16:51:51 GMT, 温绍锦 wrote:
>> I'd be more comfortable replacing the use of Unsafe with either the
>> ByteArray functions or VarHandles.
>> Using VarHandles will enable future optimizations, whereas Unsafe is a
>> primitive tool and is brittle.
>
>> I'd be more comfortable repla
On Wed, 6 Sep 2023 16:10:27 GMT, Roger Riggs wrote:
> I'd be more comfortable replacing the use of Unsafe with either the ByteArray
> functions or VarHandles. Using VarHandles will enable future optimizations,
> whereas Unsafe is a primitive tool and is brittle.
I also agree that using VarHand
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Wed, 6 Sep 2023 10:20:17 GMT, Quan Anh Mai wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> update copyright date info
>
> We can consolidate the implementation of `Integer::toString` and
> `Integer::toUnsignedString` by
On Wed, 6 Sep 2023 10:20:17 GMT, Quan Anh Mai wrote:
> We can consolidate the implementation of `Integer::toString` and
> `Integer::toUnsignedString` by taking the absolute value of the signed
> integer and move the later operation to unsigned domain. This helps remove
> the need of relying on
On Tue, 5 Sep 2023 00:10:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Mon, 4 Sep 2023 16:13:53 GMT, Claes Redestad wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> add comments
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 1534:
>
>> 1532: */
>> 1533: static int
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Mon, 4 Sep 2023 16:00:05 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Mon, 4 Sep 2023 15:50:12 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Fri, 1 Sep 2023 18:40:55 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Fri, 1 Sep 2023 18:40:55 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Thu, 20 Jul 2023 09:20:00 GMT, 温绍锦 wrote:
>> src/java.base/share/classes/java/lang/Long.java line 527:
>>
>>> 525: /**
>>> 526: * Places characters representing the long i into the
>>> 527: * character array buf. The characters are placed into
>>
>> Add the array bound check fo
On Fri, 1 Sep 2023 12:01:58 GMT, 温绍锦 wrote:
>> @cl4es can you help me to review this PR?
>
>> @wenshao How about of approach used in [James Anhalt's
>> algorithm](https://jk-jeon.github.io/posts/2022/02/jeaiii-algorithm/)?
>>
>> It reduces number of multiplications ([and store operations in cas
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Thu, 31 Aug 2023 02:36:09 GMT, 温绍锦 wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> assert bounds check
>
> @cl4es can you help me to review this PR?
> @wenshao How about of approach used in [James Anhalt's
> algorithm]
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Thu, 31 Aug 2023 19:53:17 GMT, Claes Redestad wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> assert bounds check
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 1585:
>
>> 1583: buf,
On Tue, 18 Jul 2023 01:49:17 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
On Thu, 31 Aug 2023 02:36:09 GMT, 温绍锦 wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> assert bounds check
>
> @cl4es can you help me to review this PR?
@wenshao How about of approach used in James Anhalt's algorithm:
http
On Thu, 31 Aug 2023 14:32:43 GMT, Andrew Haley wrote:
> > I'm wondering if a micro benchmark like this is very realistic.
>
> Exactly so! This is almost the canonical example of the "JMH considered
> harmful" talk I gave recently.
The subject is a joke! Yes, I love JMH, but be very careful how
On Thu, 31 Aug 2023 14:15:41 GMT, John Hendrikx wrote:
> I'm wondering if a micro benchmark like this is very realistic.
Exactly so! This is almost the canonical example of the "JMH considered
harmful" talk I gave recently.
-
PR Comment: https://git.openjdk.org/jdk/pull/14699#iss
On Tue, 18 Jul 2023 01:49:17 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
On Tue, 18 Jul 2023 01:49:17 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
On Tue, 18 Jul 2023 01:49:17 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
On Wed, 26 Jul 2023 20:31:16 GMT, Quan Anh Mai wrote:
> It could be worth it to have a cache for small integers to skip the
> calculations altogether.
this PR is only for calculation optimization. caching small values should be a
separate PR
-
PR Comment: https://git.openjdk.org/
On Tue, 18 Jul 2023 01:49:17 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
On Mon, 17 Jul 2023 20:54:25 GMT, Roger Riggs wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> Integer/Long toString test against compact strings
>>
>> Co-authored-by: liach
>
> src/java.base/share/classes/java/lang/Lo
On Tue, 18 Jul 2023 01:52:35 GMT, 温绍锦 wrote:
>> I think he means to check the `charPos` to ensure it is not out of bounds.
>
> Oh, I see, charPos needs to do bound checks, I added assert with reference
> to the implementation of StringUTF16#putChar, is this safe enough?
I think we might need t
On Tue, 18 Jul 2023 01:38:47 GMT, Chen Liang wrote:
>> The value range of the r variable is 0-99, and the length of PACKED_DIGITS
>> is 100, There is no need to check the array boundary here.
>
> I think he means to check the `charPos` to ensure it is not out of bounds.
Oh, I see, charPos needs
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Tue, 18 Jul 2023 01:26:55 GMT, 温绍锦 wrote:
>> src/java.base/share/classes/java/lang/Integer.java line 528:
>>
>>> 526: i = q;
>>> 527: charPos -= 2;
>>> 528: UNSAFE.putShortUnaligned(buf,
>>> Unsafe.ARRAY_BYTE_BASE_OFFSET + charPos, PACKED_DIGITS[r], false)
On Mon, 17 Jul 2023 20:53:23 GMT, Roger Riggs wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> Integer/Long toString test against compact strings
>>
>> Co-authored-by: liach
>
> src/java.base/share/classes/java/lang/In
On Mon, 3 Jul 2023 03:49:01 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Sun, 2 Jul 2023 02:05:48 GMT, Chen Liang wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> use upper case for static final field
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 1540:
>
>> 1538: if
On Sat, 1 Jul 2023 14:12:05 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
On Sun, 2 Jul 2023 01:27:26 GMT, Chen Liang wrote:
>> 温绍锦 has updated the pull request incrementally with one additional commit
>> since the last revision:
>>
>> use upper case for static final field
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 1538:
>
>> 1536:
On Sat, 1 Jul 2023 14:12:05 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStrin
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
On Fri, 30 Jun 2023 13:27:11 GMT, 温绍锦 wrote:
>> Optimization for:
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integers.toStri
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
> Optimization for:
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toString*"
> Optimization for:
>
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toStri
> Optimization for:
>
> Integer.toString
> Long.toString
> StringBuilder#append(int)
>
>
> # Benchmark Result
>
>
> sh make/devkit/createJMHBundle.sh
> bash configure --with-jmh=build/jmh/jars
> make test TEST="micro:java.lang.Integers.toString*"
> make test TEST="micro:java.lang.Longs.toStri
On Fri, 30 Jun 2023 06:26:53 GMT, 温绍锦 wrote:
>> Optimization for:
>>
>> Integer.toString
>> Long.toString
>> StringBuilder#append(int)
>>
>>
>> # Benchmark Result
>>
>>
>> sh make/devkit/createJMHBundle.sh
>> bash configure --with-jmh=build/jmh/jars
>> make test TEST="micro:java.lang.Integer
> 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
>
>
> bash configure --with-j
> 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
>
>
> bash configure --with-j
On Fri, 30 Jun 2023 01:03:30 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.
>>
> 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
>
>
> bash configure --with-j
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
On Wed, 28 Jun 2023 17:06:56 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.
>
> # B
On Wed, 28 Jun 2023 17:06:56 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.
>
> # B
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:java.lang.Integers.to
73 matches
Mail list logo