Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-08 Thread Roger Riggs
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

Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-07 Thread Roger Riggs
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

Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-07 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-07 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-06 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v21]

2023-09-06 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Roger Riggs
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Quan Anh Mai
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Roger Riggs
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-06 Thread Quan Anh Mai
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

Re: RFR: 8310929: Optimization for Integer.toString [v19]

2023-09-04 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v20]

2023-09-04 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v19]

2023-09-04 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v19]

2023-09-04 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v18]

2023-09-04 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v18]

2023-09-04 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v17]

2023-09-04 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v17]

2023-09-04 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-09-03 Thread Quan Anh Mai
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-09-03 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v17]

2023-09-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v16]

2023-09-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v15]

2023-09-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-09-01 Thread 温绍锦
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]

Re: RFR: 8310929: Optimization for Integer.toString [v14]

2023-09-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-09-01 Thread 温绍锦
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,

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-31 Thread Claes Redestad
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-31 Thread Andriy Plokhotnyuk
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-31 Thread Andrew Haley
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-31 Thread Andrew Haley
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-31 Thread John Hendrikx
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-30 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-08-25 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-07-27 Thread 温绍锦
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/

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-07-26 Thread Quan Anh Mai
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-20 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Chen Liang
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v13]

2023-07-17 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Chen Liang
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)

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-17 Thread Roger Riggs
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

Re: RFR: 8310929: Optimization for Integer.toString [v12]

2023-07-02 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v11]

2023-07-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v10]

2023-07-01 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v10]

2023-07-01 Thread Chen Liang
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

Re: RFR: 8310929: Optimization for Integer.toString [v10]

2023-07-01 Thread 温绍锦
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:

Re: RFR: 8310929: Optimization for Integer.toString [v10]

2023-07-01 Thread Chen Liang
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

Re: RFR: 8310929: Optimization for Integer.toString [v10]

2023-07-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v8]

2023-07-01 Thread Chen Liang
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

Re: RFR: 8310929: Optimization for Integer.toString [v9]

2023-07-01 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v8]

2023-06-30 Thread 温绍锦
> 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*"

Re: RFR: 8310929: Optimization for Integer.toString [v7]

2023-06-30 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString [v6]

2023-06-30 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString [v5]

2023-06-30 Thread 温绍锦
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

Re: RFR: 8310929: Optimization for Integer.toString [v5]

2023-06-29 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString [v4]

2023-06-29 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString [v3]

2023-06-29 Thread Chen Liang
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. >>

Re: RFR: 8310929: Optimization for Integer.toString [v3]

2023-06-29 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString [v2]

2023-06-29 Thread 温绍锦
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. >>

Re: RFR: 8310929: Optimization for Integer.toString [v2]

2023-06-29 Thread Glavo
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. >>

Re: RFR: 8310929: Optimization for Integer.toString [v2]

2023-06-29 Thread Glavo
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. >>

Re: RFR: 8310929: Optimization for Integer.toString [v2]

2023-06-28 Thread 温绍锦
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[

Re: RFR: 8310929: Optimization for Integer.toString [v2]

2023-06-28 Thread 温绍锦
> 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

Re: RFR: 8310929: Optimization for Integer.toString

2023-06-28 Thread Glavo
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

Re: RFR: 8310929: Optimization for Integer.toString

2023-06-28 Thread Raffaello Giulietti
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

RFR: 8310929: Optimization for Integer.toString

2023-06-28 Thread 温绍锦
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