Re: RFR: 8310502 : optimization for UUID#toString [v3]

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 13:32:32 GMT, 温绍锦 wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> 8310502 : hex literal > > * benchmark code >

Re: RFR: 8310502 : optimization for UUID#toString [v7]

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 15:21:45 GMT, Roger Riggs wrote: > CDS can initialize arrays efficiently. The Long class already uses CDS to > initialize the cache of Long values. See the LongCache code for an example of > initializing from CDS with a fallback to direct initialization. You could > move

Re: RFR: 8310502 : optimization for UUID#toString [v7]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 19:02:59 GMT, ExE Boss wrote: >> src/java.base/share/classes/java/lang/Long.java line 563: >> >>> 561: StringUTF16.putChar(buf, 7, (byte) i3); >>> 562: StringUTF16.putChar(buf, 8, '-'); >>> 563: StringUTF16.putChar(buf, 9, (byte) (i4 >>

Re: RFR: 8310502 : optimization for UUID#toString [v6]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString [v5]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread Glavo
On Wed, 21 Jun 2023 14:39:18 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread ExE Boss
On Wed, 21 Jun 2023 14:53:22 GMT, Roger Riggs wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> add annotation Stable > > src/java.base/share/classes/java/lang/Long.java line 563: > >> 561:

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread Roger Riggs
On Wed, 21 Jun 2023 14:31:20 GMT, Chen Liang wrote: >> Not sure if this can be applied but some months ago, I optimized Bits to use >> VarHandles rather than explicitly shifting bits around. This gave us a >> significant performance increase: >> >>

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread Roger Riggs
On Wed, 21 Jun 2023 14:39:18 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString [v4]

2023-06-21 Thread Chen Liang
On Wed, 21 Jun 2023 14:13:34 GMT, Per Minborg wrote: >>> > Another thing to try is moving fastUUID out of Long - moving to an array >>> > of precomputed hex values means it is not tied to Long internals anymore. >>> >>> A note about `@Stable`: `Integer.digits` and `HEX256` are not, and they

Re: RFR: 8310502 : optimization for UUID#toString [v3]

2023-06-21 Thread Per Minborg
On Wed, 21 Jun 2023 09:48:54 GMT, 温绍锦 wrote: >>> Another thing to try is moving fastUUID out of Long - moving to an array of >>> precomputed hex values means it is not tied to Long internals anymore. >> >> A note about `@Stable`: `Integer.digits` and `HEX256` are not, and they >> might see

Re: RFR: 8310502 : optimization for UUID#toString [v3]

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 11:06:08 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: 8310502 : optimization for UUID#toString [v3]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString [v2]

2023-06-21 Thread Raffaello Giulietti
On Wed, 21 Jun 2023 10:11:09 GMT, 温绍锦 wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark Mode Cnt

Re: RFR: 8310502 : optimization for UUID#toString [v2]

2023-06-21 Thread 温绍锦
> By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt Score Error Units >

Re: RFR: 8310502 : optimization for UUID#toString

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 08:58:53 GMT, Chen Liang wrote: > > Another thing to try is moving fastUUID out of Long - moving to an array of > > precomputed hex values means it is not tied to Long internals anymore. > > A note about `@Stable`: `Integer.digits` and `HEX256` are not, and they might >

Re: RFR: 8310502 : optimization for UUID#toString

2023-06-21 Thread Chen Liang
On Wed, 21 Jun 2023 08:40:43 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/lang/Long.java line 97: >> >>> 95: + (lo < 10 ? '0' + lo : 'a' + lo - 10)); >>> 96: } >>> 97: } >> >> Are you checking the impact on startup? I guess I would have expected to see

Re: RFR: 8310502 : optimization for UUID#toString

2023-06-21 Thread 温绍锦
On Wed, 21 Jun 2023 07:58:11 GMT, Alan Bateman wrote: >> By optimizing the implementation of java.lang.Long#fastUUID, the performance >> of the java.util.UUID#toString method can be significantly improved. >> >> The following are the test results of JMH: >> >> Benchmark

Re: RFR: 8310502 : optimization for UUID#toString

2023-06-21 Thread Alan Bateman
On Wed, 21 Jun 2023 07:28:54 GMT, 温绍锦 wrote: > By optimizing the implementation of java.lang.Long#fastUUID, the performance > of the java.util.UUID#toString method can be significantly improved. > > The following are the test results of JMH: > > Benchmark Mode Cnt

RFR: 8310502 : optimization for UUID#toString

2023-06-21 Thread 温绍锦
By optimizing the implementation of java.lang.Long#fastUUID, the performance of the java.util.UUID#toString method can be significantly improved. The following are the test results of JMH: Benchmark Mode Cnt Score Error Units UUIDUtilsBenchmark.new thrpt