Re: String encodeASCII

2023-02-18 Thread Brett Okken
Thanks for taking a look at this. That is a pretty good improvement with a much smaller change. I recognize the intricacies of bootstrapping, but have no expertise. Would using Unsafe directly be easier? Particularly for shorter strings, doing the copying and checking together rather than as

Re: String encodeASCII

2023-02-18 Thread Claes Redestad
Hi, general comment: String might be one of the trickier places to add a VarHandle dependency, since String is used very early in the bootstrap and depended upon by everything else, so I’d expect such a solution would have to navigate potential circularity issues carefully. It’d be good to

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v16]

2023-02-18 Thread Chris Hennick
On Tue, 4 Oct 2022 17:36:56 GMT, Chris Hennick wrote: >> This PR improves both the worst-case performance of `nextExponential` and >> `nextGaussian` and the distribution of output at the tails. It fixes the >> following imperfections: >> >> * Repeatedly adding

Re: RFR: 8302815 Use new Math.clamp method in core libraries [v2]

2023-02-18 Thread Tagir F . Valeev
> For cleanup and dogfooding the new method, it would be nice to use Math.clamp > where possible in java.base. See PR #12428. > > As Math.clamp performs an additional check that min is not greater than max, > I conservatively replaced only those occurrences where I can see that this >

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-18 Thread Brian Goetz
On Fri, 17 Feb 2023 02:11:10 GMT, Mandy Chung wrote: >> David M. Lloyd has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use a unique index for the dumped lambda class instead of a time stamp > > `this_class` in the classbyte is shown in

Speed up StringLatin1.regionMatchesCI_UTF16

2023-02-18 Thread Eirik Bjørsnøs
Hi, This PR continues the effort to speed up case-insensitive string comparisons, this time tackling comparison of latin1-coded strings with utf16-coded strings: https://github.com/openjdk/jdk/pull/12637 This builds on top of #12632, it makes sense to review that one first. Thanks, Eirik.

String encodeASCII

2023-02-18 Thread Brett Okken
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L976-L981 For String.encodeASCII, with the LATIN1 coder is there any interest in exploring the performance impacts of utilizing a byteArrayViewVarHandle to read/write as longs and utilize a bitmask to

Re: RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

2023-02-18 Thread liach
On Thu, 9 Feb 2023 18:11:18 GMT, Volker Simonis wrote: >> Prior to >> [JDK-8239384](https://bugs.openjdk.org/browse/JDK-8239384)/[JDK-8238358](https://bugs.openjdk.org/browse/JDK-8238358) >> LambdaMetaFactory has created VM-anonymous classes which could easily be >> unloaded once they were

Re: RFR: 8302315: Examine cost of clone of primitive arrays compared to arraycopy

2023-02-18 Thread Claes Redestad
On Fri, 17 Feb 2023 09:58:54 GMT, Claes Redestad wrote: > During work on #12453 @schlosna reported that `array.clone()` might > underperform `System.arraycopy` in microbenchmarks and I opted to go with > `arraycopy` throughout while investigating. > > Testing on x86 (SandyBridge, AVX2) I

Integrated: 8302315: Examine cost of clone of primitive arrays compared to arraycopy

2023-02-18 Thread Claes Redestad
On Fri, 17 Feb 2023 09:58:54 GMT, Claes Redestad wrote: > During work on #12453 @schlosna reported that `array.clone()` might > underperform `System.arraycopy` in microbenchmarks and I opted to go with > `arraycopy` throughout while investigating. > > Testing on x86 (SandyBridge, AVX2) I

Integrated: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos

2023-02-18 Thread Eirik Bjorsnos
On Mon, 30 Jan 2023 10:32:38 GMT, Eirik Bjorsnos wrote: > After finding a hash match, getEntryPos needs to compare the lookup name up > to the encoded entry name in the CEN. This comparison is done by decoding the > entry name into a String. The names can then be compared using the String >

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v15]

2023-02-18 Thread Lance Andersen
On Wed, 15 Feb 2023 11:44:17 GMT, Eirik Bjorsnos wrote: >> After finding a hash match, getEntryPos needs to compare the lookup name up >> to the encoded entry name in the CEN. This comparison is done by decoding >> the entry name into a String. The names can then be compared using the >>

RFR: 8302815 Use new Math.clamp method in core libraries

2023-02-18 Thread Tagir F . Valeev
For cleanup and dogfooding the new method, it would be nice to use Math.clamp where possible in java.base. See PR #12428. As Math.clamp performs an additional check that min is not greater than max, I conservatively replaced only those occurrences where I can see that this invariant is always

Speed up StringLatin1.regionMatchesCI

2023-02-18 Thread Eirik Bjørsnøs
Hi, The following PR suggests we can speed up StringLatin1.regionMatchesCI by applying 'the oldest ASCII trick in the book': https://github.com/openjdk/jdk/pull/12632 Thanks, Eirik.

Re: RFR: 8302315: Examine cost of clone of primitive arrays compared to arraycopy

2023-02-18 Thread Alan Bateman
On Fri, 17 Feb 2023 09:58:54 GMT, Claes Redestad wrote: > During work on #12453 @schlosna reported that `array.clone()` might > underperform `System.arraycopy` in microbenchmarks and I opted to go with > `arraycopy` throughout while investigating. > > Testing on x86 (SandyBridge, AVX2) I

Re: RFR: 8302806: (fs) Remove unused enum sun.nio.file.SensitivityWatchEventModifier

2023-02-18 Thread Alan Bateman
On Sat, 18 Feb 2023 00:11:29 GMT, Brian Burkhalter wrote: > This enum is not used in the JDK and did not appear in external source code > searches. This API should probably have been deprecated many releases ago. It's the jdk.unsupported module so it may be possible to remove without first