Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v19]

2023-06-24 Thread Alan Bateman
On Fri, 23 Jun 2023 04:52:16 GMT, 温绍锦 wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> remove unused import > > Latest benchmark results (commit id > [0d34655](https://github.com/openjdk/jdk/pull/14578/commits/0d346558e00cf

Re: RFR: 8308899: Introduce Classfile.Context and improve Classfile.Option(s) [v21]

2023-06-24 Thread Chen Liang
On Wed, 21 Jun 2023 06:29:40 GMT, Adam Sotona wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> ClassfileBenchmark::transformWithNewMaps changed to transformWithAddedNOP > > I think we've resolved controversy about gl

Re: RFR: 8310848: Convert ClassDesc and MethodTypeDesc to be stored in static final fields [v2]

2023-06-24 Thread Chen Liang
> This would encourage Classfile API users to use the descriptors as constants, > which can improve performance by avoiding repeated validation and reusing > cached descriptor strings for MethodTypeDesc. This patch updates usages in > the main codebase and benchmarks; tests are left untouched.

RFR: 8310848: Convert ClassDesc and MethodTypeDesc to be stored in static final fields

2023-06-24 Thread Chen Liang
This would encourage Classfile API users to use the descriptors as constants, which can improve performance by avoiding repeated validation and reusing cached descriptor strings for MethodTypeDesc. This patch updates usages in the main codebase and benchmarks; tests are left untouched.

Re: RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v21]

2023-06-24 Thread ExE Boss
On Fri, 23 Jun 2023 23:25:25 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/lang/Long.java line 493: >> >>> 491: | H256[((int) lsb) & 0xff]); >>> 492: >>> 493: return new String(buf, LATIN1); >> >> Note that this isn’t correct when `COMPACT_STRINGS` is `fal

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v5]

2023-06-24 Thread Glavo
> `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR reimplements them using `Unsafe`, which reduces th

Re: RFR: 8310837: Use ByteArrayLittleEndian in java.util.zip

2023-06-24 Thread Glavo
On Sat, 24 Jun 2023 06:11:55 GMT, Glavo wrote: >> src/java.base/share/classes/jdk/internal/util/ByteArrayLittleEndian.java >> line 150: >> >>> 148: public static long getUnsignedInt(byte[] array, int offset) { >>> 149: return Integer.toUnsignedLong((int) INT.get(array, offset)); >>>

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v4]

2023-06-24 Thread Glavo
> `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR reimplements them using `Unsafe`, which reduces th

RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

2023-06-24 Thread Pavel Rappo
Please review this PR to use modern APIs and language features to simplify equals, hashCode, and compareTo for BigInteger. If you have any performance concerns, please raise them. This PR is cherry-picked from a bigger, not-yet-published PR, to test the waters. That latter PR will be published

Re: RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

2023-06-24 Thread Pavel Rappo
On Fri, 23 Jun 2023 17:27:00 GMT, Pavel Rappo wrote: > Please review this PR to use modern APIs and language features to simplify > equals, hashCode, and compareTo for BigInteger. If you have any performance > concerns, please raise them. > > This PR is cherry-picked from a bigger, not-yet-pub

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v3]

2023-06-24 Thread Glavo
On Sat, 24 Jun 2023 09:16:38 GMT, Chen Liang wrote: > Do the Unsafe methods throw NPE on null array argument? No, but `arrayOffset` will throw. - PR Review Comment: https://git.openjdk.org/jdk/pull/14636#discussion_r1240681104

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v3]

2023-06-24 Thread Glavo
> `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR reimplements them using `Unsafe`, which reduces th

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v2]

2023-06-24 Thread Glavo
> `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR reimplements them using `Unsafe`, which reduces th

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe

2023-06-24 Thread Chen Liang
On Sat, 24 Jun 2023 06:42:18 GMT, Glavo wrote: > `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR r

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe

2023-06-24 Thread Glavo
On Sat, 24 Jun 2023 06:42:18 GMT, Glavo wrote: > `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR r

Re: RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe

2023-06-24 Thread Chen Liang
On Sat, 24 Jun 2023 06:42:18 GMT, Glavo wrote: > `ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can > be used in many places to performance tuning. > > Currently they are implemented by `VarHandle`, so using them may have some > impact on startup time. > > This PR r

RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe

2023-06-24 Thread Glavo
`ByteArray` and `ByteArrayLittleEndian` are very useful tool classes that can be used in many places to performance tuning. Currently they are implemented by `VarHandle`, so using them may have some impact on startup time. This PR reimplements them using `Unsafe`, which reduces the impact on st