RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2

2023-01-20 Thread Scott Gibbons
Added code for Base64 acceleration (encode and decode) which will accelerate ~4x for AVX2 platforms. Encode performance: **Old:** Benchmark (maxNumBytes) Mode Cnt Score Error Units Base64Encode.testBase64Encode 1024 thrpt3 4309.439 ± 2.632

Re: RFR: 8300487: Store cardinality as a field in BitSet [v6]

2023-01-20 Thread fabioromano1
> The enanchment is useful for applications that make heavy use of BitSet > objects as sets of integers, and therefore they need to make a lot of calls > to cardinality() method, which actually require linear time in the number of > words in use by the bit set. > This optimization reduces the

Re: RFR: 8300706: Use @snippet in java.text [v3]

2023-01-20 Thread Naoto Sato
On Fri, 20 Jan 2023 19:54:44 GMT, Justin Lu wrote: >> Some classes / interfaces in java.text have already implemented JEP 413. >> >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> the rest of >>

Re: RFR: 8300706: Use @snippet in java.text [v3]

2023-01-20 Thread Justin Lu
> Some classes / interfaces in java.text have already implemented JEP 413. > > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for the > rest of > [java.text](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/package-summary.html) > including: > -

Re: RFR: 8300706: Use @snippet in java.text [v2]

2023-01-20 Thread Naoto Sato
On Fri, 20 Jan 2023 18:34:37 GMT, Lance Andersen wrote: >> src/java.base/share/classes/java/text/DecimalFormat.java line 343: >> >>> 341: * {@code >>> 342: * // Print out a number using the localized number, integer, currency, >>> 343: * // and percent format for each locale}{@code >> >>

Re: RFR: 8300706: Use @snippet in java.text [v2]

2023-01-20 Thread Naoto Sato
On Fri, 20 Jan 2023 18:47:54 GMT, Justin Lu wrote: >> Some classes / interfaces in java.text have already implemented JEP 413. >> >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> the rest of >>

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat [v2]

2023-01-20 Thread Iris Clark
On Fri, 20 Jan 2023 17:31:26 GMT, Justin Lu wrote: >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) >> and >>

Re: RFR: 8300706: Use @snippet in java.text [v2]

2023-01-20 Thread Justin Lu
> Some classes / interfaces in java.text have already implemented JEP 413. > > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for the > rest of > [java.text](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/package-summary.html) > including: > -

Re: RFR: 8300706: Use @snippet in java.text

2023-01-20 Thread Lance Andersen
On Fri, 20 Jan 2023 17:57:47 GMT, Justin Lu wrote: >> Some classes / interfaces in java.text have already implemented JEP 413. >> >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> the rest of >>

Re: RFR: 8300236: Use VarHandle access in Data(Input | Output)Stream classes

2023-01-20 Thread Roger Riggs
On Wed, 18 Jan 2023 16:34:57 GMT, Per Minborg wrote: > This PR proposes using a performance optimization using a new supported API > for operations similar to those found in `java.io.Bits` src/java.base/share/classes/java/io/ObjectStreamClass.java line 2486: > 2484: ); > 2485:

Re: RFR: 8300706: Use @snippet in java.text

2023-01-20 Thread Justin Lu
On Fri, 20 Jan 2023 17:41:35 GMT, Justin Lu wrote: > Some classes / interfaces in java.text have already implemented JEP 413. > > This PR implements _JEP 413: Code Snippets in Java API Documentation_ for the > rest of >

RFR: 8300706: Use @snippet in java.text

2023-01-20 Thread Justin Lu
Some classes / interfaces in java.text have already implemented JEP 413. This PR implements _JEP 413: Code Snippets in Java API Documentation_ for the rest of [java.text](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/package-summary.html) including: - BreakIterator -

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests [v2]

2023-01-20 Thread Mandy Chung
On Fri, 20 Jan 2023 04:53:10 GMT, David Holmes wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> move the comment to @comment > > test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java line 284: > >>

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests [v2]

2023-01-20 Thread Mandy Chung
> `java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations > and the test cases are executed in the warm up loop with 2 iterations to > verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. > > This PR proposes to scale the compile threshold to 0.1 such that

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat [v2]

2023-01-20 Thread Lance Andersen
On Fri, 20 Jan 2023 17:31:26 GMT, Justin Lu wrote: >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) >> and >>

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat [v2]

2023-01-20 Thread Naoto Sato
On Fri, 20 Jan 2023 17:31:26 GMT, Justin Lu wrote: >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) >> and >>

Re: RFR: 8300589: Use @snippet and @linkplain in java.text.CollationKey and java.text.CompactNumberFormat [v2]

2023-01-20 Thread Justin Lu
> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for > [java.text.CollationKey](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/CollationKey.html) > and >

Integrated: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle

2023-01-20 Thread Mandy Chung
On Thu, 19 Jan 2023 19:14:38 GMT, Mandy Chung wrote: > `VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to > a static `Field`. It's fragile to assume that the location of a static > field returned by `Unsafe.staticFieldBase` is a Class object.This changes > the

Re: RFR: 8299807: String.newStringUTF8NoRepl and getBytesUTF8NoRepl always copy arrays

2023-01-20 Thread Glavo
On Mon, 9 Jan 2023 03:34:55 GMT, Glavo wrote: > `JavaLangAccess::newStringUTF8NoRepl` and > `JavaLangAccess::getBytesUTF8NoRepl` are not implemented correctly. They > always copy arrays, rather than avoiding copying as much as possible as > javadoc says. > > I ran the tier1 test without any

Withdrawn: 8299807: String.newStringUTF8NoRepl and getBytesUTF8NoRepl always copy arrays

2023-01-20 Thread Glavo
On Mon, 9 Jan 2023 03:34:55 GMT, Glavo wrote: > `JavaLangAccess::newStringUTF8NoRepl` and > `JavaLangAccess::getBytesUTF8NoRepl` are not implemented correctly. They > always copy arrays, rather than avoiding copying as much as possible as > javadoc says. > > I ran the tier1 test without any

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder [v2]

2023-01-20 Thread Lance Andersen
On Fri, 20 Jan 2023 12:19:50 GMT, Claes Redestad wrote: >> `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates >> on a `byte[]` subrange. It can profitably use the recently introduced >> `ArraysSupport::vectorizedHashCode` method to see a speed-up, which >> translates

Integrated: 8038146: Clarify Map.Entry's connection to the underlying map

2023-01-20 Thread Stuart Marks
On Thu, 12 Jan 2023 01:50:51 GMT, Stuart Marks wrote: > Also additional verbiage regarding Map.Entry objects in general and their > possible connection to an underlying Map. This pull request has now been integrated. Changeset: c6d56003 Author:Stuart Marks URL:

RFR: 8299858: [Metrics] Swap memory limit reported incorrectly when too large

2023-01-20 Thread Severin Gehwolf
Please review this fix to [JDK-8292541](https://bugs.openjdk.org/browse/JDK-8292541) which adds the same handling for swap values exceeding what's possible in the non-container case. I.e. treats it as unlimited and fixes the reporting. This has been handled on the hotspot side similarly with

Re: RFR: 8299858: [Metrics] Swap memory limit reported incorrectly when too large

2023-01-20 Thread Severin Gehwolf
On Fri, 20 Jan 2023 15:53:09 GMT, Severin Gehwolf wrote: > Please review this fix to > [JDK-8292541](https://bugs.openjdk.org/browse/JDK-8292541) which adds the > same handling for swap values exceeding what's possible in the non-container > case. I.e. treats it as unlimited and fixes the

Re: RFR: 8206890: jlink --endian XXX generates unusable image if endian-ness does not match architecture

2023-01-20 Thread Jaikiran Pai
On Tue, 17 Jan 2023 17:41:33 GMT, Jim Laskey wrote: >> Can I please get a review for this change which proposes to fix the issue >> reported in https://bugs.openjdk.org/browse/JDK-8206890? >> >> The `jlink` command allows a `--endian` option to specify the byte order in >> the generated

Re: RFR: 8206890: jlink --endian XXX generates unusable image if endian-ness does not match architecture

2023-01-20 Thread Jaikiran Pai
On Wed, 11 Jan 2023 13:19:32 GMT, Jaikiran Pai wrote: > Can I please get a review for this change which proposes to fix the issue > reported in https://bugs.openjdk.org/browse/JDK-8206890? > > The `jlink` command allows a `--endian` option to specify the byte order in > the generated image.

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Claes Redestad
On Wed, 18 Jan 2023 16:53:04 GMT, Claes Redestad wrote: > `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on > a `byte[]` subrange. It can profitably use the recently introduced > `ArraysSupport::vectorizedHashCode` method to see a speed-up, which > translates to a

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder [v2]

2023-01-20 Thread Claes Redestad
> `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on > a `byte[]` subrange. It can profitably use the recently introduced > `ArraysSupport::vectorizedHashCode` method to see a speed-up, which > translates to a small but significant speed-up on `ZipFile` creation. > >

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Claes Redestad
On Fri, 20 Jan 2023 11:25:22 GMT, Lance Andersen wrote: >> `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates >> on a `byte[]` subrange. It can profitably use the recently introduced >> `ArraysSupport::vectorizedHashCode` method to see a speed-up, which >> translates

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Claes Redestad
On Fri, 20 Jan 2023 11:10:13 GMT, Alan Bateman wrote: > > FWIW the micro is derived from the sibling `ZipFileGetEntry` micro in the > > same directory. It's not exactly necessary for this use case to add such a > > benchmark, but I think there's value in verifying that optimizing > >

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests

2023-01-20 Thread Jorn Vernee
On Thu, 19 Jan 2023 20:43:11 GMT, Mandy Chung wrote: > `java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations > and the test cases are executed in the warm up loop with 2 iterations to > verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. > > This PR

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Lance Andersen
On Wed, 18 Jan 2023 16:53:04 GMT, Claes Redestad wrote: > `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on > a `byte[]` subrange. It can profitably use the recently introduced > `ArraysSupport::vectorizedHashCode` method to see a speed-up, which > translates to a

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Alan Bateman
On Wed, 18 Jan 2023 16:53:04 GMT, Claes Redestad wrote: > `ZipCoder::checkedHashCode` emulates `StringLatin1::hashCode` but operates on > a `byte[]` subrange. It can profitably use the recently introduced > `ArraysSupport::vectorizedHashCode` method to see a speed-up, which > translates to a

Re: RFR: 8300493: Use ArraysSupport.vectorizedHashCode in j.u.zip.ZipCoder

2023-01-20 Thread Alan Bateman
On Thu, 19 Jan 2023 09:46:12 GMT, Claes Redestad wrote: > FWIW the micro is derived from the sibling `ZipFileGetEntry` micro in the > same directory. It's not exactly necessary for this use case to add such a > benchmark, but I think there's value in verifying that optimizing > `checkedHash`

Re: RFR: 8300207: Add a pre-check for the number of canonical equivalent permutations in j.u.r.Pattern [v2]

2023-01-20 Thread Raffaello Giulietti
On Thu, 19 Jan 2023 15:27:04 GMT, Raffaello Giulietti wrote: >> - Strengthen a computation that could overflow. >> - Specify that use of CANON_EQ could exhaust memory in the compilation phase. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since

Re: RFR: 8300487: Store cardinality as a field in BitSet [v5]

2023-01-20 Thread fabioromano1
On Thu, 19 Jan 2023 23:14:12 GMT, John R Rose wrote: > I'll pile on: This optimization doesn't buy much in today's world, where most > machines execute `bitCount` in one cycle. It saves a trivial loop. Over very > large bitsets that saves something, but most bitsets are likely to be medium >