Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Laurent Bourgès
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v2]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 10:57:35 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/java/lang/Shutdown.java line 162: >> >>> 160: * If the system logger {@code java.lang.Runtime} is enabled for >>> logging level DEBUG/FINE >>> 161: * the stack trace of the call to {@code

Re: RFR: JDK-8266431: Dual-Pivot Quicksort improvements (Radix sort) [v18]

2023-02-13 Thread Laurent Bourgès
On Wed, 9 Nov 2022 21:06:50 GMT, iaroslavski wrote: >> Sorting: >> >> - adopt radix sort for sequential and parallel sorts on >> int/long/float/double arrays (almost random and length > 6K) >> - fix tryMergeRuns() to better handle case when the last run is a single >> element >> - minor

Integrated: 8302214: Typo in javadoc of Arrays.compare and Arrays.mismatch

2023-02-13 Thread Eirik Bjorsnos
On Thu, 9 Feb 2023 10:13:03 GMT, Eirik Bjorsnos wrote: > The Javadocs of Arrays.compare and Arrays.mismatch uses the incorrect > capitalization `atoIndex` and `btoIndex` when referencing the corresponding > `aToIndex` and `bToIndex` parameters. > > Sample: > > > * specified ranges [{@code

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-13 Thread Xiaowei Lu
On Fri, 10 Feb 2023 10:00:05 GMT, Xiaowei Lu wrote: > [JDK-8269667](https://bugs.openjdk.org/browse/JDK-8269667) has uncovered the > poor performance of BigDecimal.divide under certain circumstance. > > We confront similar situations when benchmarking Spark3 on TPC-DS test kit. > According to

Integrated: 8301226: Add clamp() methods to java.lang.Math and to StrictMath

2023-02-13 Thread Tagir F . Valeev
On Sat, 4 Feb 2023 13:24:11 GMT, Tagir F. Valeev wrote: > clamp() methods added to Math and StrictMath > > `int clamp(long, int, int)` is somewhat different, as it accepts a `long` > value and safely clamps it to an `int` range. Other overloads work with a > particular type (long, float and

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-13 Thread Xiaowei Lu
On Tue, 14 Feb 2023 03:20:14 GMT, Sergey Kuksenko wrote: > The pr looks promising in terms of performance. What makes sense to do: > > *) Don't rely on external benchmarks. It's fine if such exists, but anyway > set of microbenchmarks (using JMH) will be much better. More clear, readable >

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-13 Thread Sergey Kuksenko
On Fri, 10 Feb 2023 10:00:05 GMT, Xiaowei Lu wrote: > [JDK-8269667](https://bugs.openjdk.org/browse/JDK-8269667) has uncovered the > poor performance of BigDecimal.divide under certain circumstance. > > We confront similar situations when benchmarking Spark3 on TPC-DS test kit. > According to

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x

2023-02-13 Thread Amit Kumar
On Tue, 7 Feb 2023 07:07:54 GMT, Alan Bateman wrote: >>> Hi @AlanBateman , >>> with latest changes (doing inflate/deinflate) test passes over s390 and x86 >>> as well. Please take a look now. >> >> Good. One thing to try is to just deflate/inflate into out1/out2, no need >> for the

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v15]

2023-02-13 Thread Sandhya Viswanathan
On Thu, 9 Feb 2023 18:08:15 GMT, Scott Gibbons wrote: >> 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

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v2]

2023-02-13 Thread Roger Riggs
> It can be difficult to find the cause of calls to > `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java > runtime exits. > The status value and stack trace are logged using the System Logger named > `java.lang.Runtime` with message level `System.Logger.Level.DEBUG`.

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Joe Darcy
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: JDK-8302026: Port fdlibm inverse trig functions (asin, acos, atan) to Java

2023-02-13 Thread Joe Darcy
On Mon, 13 Feb 2023 22:03:14 GMT, Joe Darcy wrote: > Proceeding down the line of FDLIBM functions to be ported, next up are asin, > acos, and atan. > > Diffs of the various versions will follow in a separate message. > > There were no unusual coding idioms encountered in porting these

Re: RFR: JDK-8302026: Port fdlibm inverse trig functions (asin, acos, atan) to Java

2023-02-13 Thread Joe Darcy
On Mon, 13 Feb 2023 22:03:14 GMT, Joe Darcy wrote: > Proceeding down the line of FDLIBM functions to be ported, next up are asin, > acos, and atan. > > Diffs of the various versions will follow in a separate message. > > There were no unusual coding idioms encountered in porting these

RFR: JDK-8302026: Port fdlibm inverse trig functions (asin, acos, atan) to Java

2023-02-13 Thread Joe Darcy
Proceeding down the line of FDLIBM functions to be ported, next up are asin, acos, and atan. Diffs of the various versions will follow in a separate message. There were no unusual coding idioms encountered in porting these methods. - Commit messages: - Appease jcheck. - Add

RFR: JDK-8301460: Clean up LambdaForm to reference BasicType enums directly

2023-02-13 Thread Mandy Chung
`LambdaForm` declares int constants for `BasicType::ordinal` to workaround JDK-8161245. Now these int constants are no longer needed.This removes these int constants and reference `BasicType` enums directly. - Commit messages: - JDK-8301460: Code in LambdaForm.java still

Re: RFR: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields

2023-02-13 Thread Mandy Chung
On Mon, 13 Feb 2023 19:35:52 GMT, Mandy Chung wrote: > I overlooked in the fix for JDK-8297757 that it should have passed the > declaring class of the static fields rather than the reference class passed > to `Lookup::findStaticVarHandle`. `InternalError` is thrown if the field is not found

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

2023-02-13 Thread Lance Andersen
On Thu, 9 Feb 2023 12:07:04 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 >>

Re: RFR: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields

2023-02-13 Thread Paul Sandoz
On Mon, 13 Feb 2023 19:35:52 GMT, Mandy Chung wrote: > I overlooked in the fix for JDK-8297757 that it should have passed the > declaring class of the static fields rather than the reference class passed > to `Lookup::findStaticVarHandle`. Doh! I think the previous fix may have also result in

Re: RFR: 8205592: BigDecimal.doubleValue() is depressingly slow

2023-02-13 Thread Raffaello Giulietti
On Mon, 13 Feb 2023 17:53:46 GMT, Andriy Plokhotnyuk wrote: >> This PR is waiting for a review > > @rgiulietti Thanks for keeping making JDK faster! > > I have a couple of review comments: > > 1) For the line >

Re: RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 16:57:17 GMT, Severin Gehwolf wrote: > The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. > However, > the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent > `kind`), might > be non-zero in the lower 3 bits (values up to `0x07`

Re: RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Jim Laskey
On Mon, 13 Feb 2023 16:57:17 GMT, Severin Gehwolf wrote: > The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. > However, > the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent > `kind`), might > be non-zero in the lower 3 bits (values up to `0x07`

RFR: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields

2023-02-13 Thread Mandy Chung
I overlooked in the fix for JDK-8297757 that it should have passed the declaring class of the static fields rather than the reference class passed to `Lookup::findStaticVarHandle`. - Commit messages: - 8302260: VarHandle.describeConstable() fails to return a nominal descriptor

Re: RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Thomas Stuefe
On Mon, 13 Feb 2023 16:57:17 GMT, Severin Gehwolf wrote: > The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. > However, > the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent > `kind`), might > be non-zero in the lower 3 bits (values up to `0x07`

Re: RFR: 8205592: BigDecimal.doubleValue() is depressingly slow

2023-02-13 Thread Andriy Plokhotnyuk
On Tue, 31 Jan 2023 13:39:46 GMT, Raffaello Giulietti wrote: >> A reimplementation of `BigDecimal.[double|float]Value()` to enhance >> performance, avoiding an intermediate string and its subsequent parsing on >> the slow path. > > This PR is waiting for a review @rgiulietti Thanks for

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v15]

2023-02-13 Thread Scott Gibbons
On Fri, 10 Feb 2023 23:18:47 GMT, Claes Redestad wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add URL to microbenchmark > > Marked as reviewed by redestad (Reviewer). @cl4es Can you please initiate the

RFR: 8302267: [jittester] Improve separation of test generation and execution

2023-02-13 Thread Evgeny Nikitin
Please review a set of improvements that should improve working with other fuzzing generators and usage of JitTesterDriver with tests generated not by the JITTester: - Provide better separation of individual test generation from java file writing, compiling, executing, etc.; - Introduce

RFR: 8302337: JDK crashes if lib/modules contains non-zero byte containing ATTRIBUTE_END

2023-02-13 Thread Severin Gehwolf
The `jimage` location attributes are terminated with `ATTRIBUTE_END`-kinds. However, the byte containing `ATTRIBUTE_END` (most significant 5 bits, represent `kind`), might be non-zero in the lower 3 bits (values up to `0x07` represent `ATTRIBUTE_END`). The JDK code handles this case correctly

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Raffaello Giulietti
On Mon, 13 Feb 2023 17:05:06 GMT, Quan Anh Mai wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Comments in tests > > Just a small point: > >> Using similar approach in other cases (e.g. `float clamp(double,

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Quan Anh Mai
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Quan Anh Mai
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch [v2]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 16:10:14 GMT, Claes Redestad wrote: >> We can improve various String methods such as `startsWith`, `endsWith` and >> `regionMatches` by leveraging the intrinsified mismatch methods in >> `ArraysSupport`. > > Claes Redestad has updated the pull request incrementally with one

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Quan Anh Mai
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch [v2]

2023-02-13 Thread Eirik Bjorsnos
On Mon, 13 Feb 2023 16:10:14 GMT, Claes Redestad wrote: >> We can improve various String methods such as `startsWith`, `endsWith` and >> `regionMatches` by leveraging the intrinsified mismatch methods in >> `ArraysSupport`. > > Claes Redestad has updated the pull request incrementally with one

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. src/java.base/share/classes/java/lang/String.java line 2272: > 2270:

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Roger Riggs
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. Look good. - Marked as reviewed by rriggs (Reviewer). PR:

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Sergey Tsypanov
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. Looks simple and harmless. - Marked as reviewed by

RFR: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp

2023-02-13 Thread Severin Gehwolf
Could I please get a review of this trivial comment-only change? `imageFile.hpp` describes some properties of the jimage file `lib/modules`. However, I don't think the comment example matches current code in the JDK.

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-13 Thread Tagir F . Valeev
On Tue, 7 Feb 2023 12:53:25 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Eirik Bjorsnos
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. ` cat PR >> https://cl4es.github.io/` - PR:

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v10]

2023-02-13 Thread Claes Redestad
On Mon, 13 Feb 2023 09:59:52 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> copy arrays more efficiently when exactly the whole input array is to be >> copied. This helps eliminate range checks and has been verified to help >>

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v10]

2023-02-13 Thread Alan Bateman
On Mon, 13 Feb 2023 09:59:52 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> copy arrays more efficiently when exactly the whole input array is to be >> copied. This helps eliminate range checks and has been verified to help >>

Integrated: 8301958: Reduce Arrays.copyOf/-Range overheads

2023-02-13 Thread Claes Redestad
On Tue, 7 Feb 2023 13:30:35 GMT, Claes Redestad wrote: > This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to > copy arrays more efficiently when exactly the whole input array is to be > copied. This helps eliminate range checks and has been verified to help > various

Integrated: 8300139 : [AIX] Use pthreads to avoid JNI_createVM call from primordial thread

2023-02-13 Thread Varada M
On Tue, 31 Jan 2023 05:24:35 GMT, Varada M wrote: > 1. test/jdk/jni/nullCaller/NullCallerTest.java > 2. test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java > 3. test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java > > The above tests were blocked on AIX

Re: RFR: 8301627: System.exit and Runtime.exit debug logging

2023-02-13 Thread Daniel Fuchs
On Sun, 12 Feb 2023 18:15:25 GMT, Alan Bateman wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >>

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Laurent Bourgès
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. Amazing gains! Congratulations - PR:

Re: RFR: 8302226 failure_handler native.core should wait for coredump to finish [v2]

2023-02-13 Thread Ludvig Janiuk
> Update open/test/failure_handler/src/share/conf/linux.properties to handle > core dumps more correctly. Ludvig Janiuk has updated the pull request incrementally with one additional commit since the last revision: add mac - Changes: - all:

Re: RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Claes Redestad
On Mon, 13 Feb 2023 09:59:24 GMT, Claes Redestad wrote: > We can improve various String methods such as `startsWith`, `endsWith` and > `regionMatches` by leveraging the intrinsified mismatch methods in > `ArraysSupport`. Microbenchmarking shows decent improvements on small data, scaling up to

RFR: 8302163: Speed up various String comparison methods with ArraysSupport.mismatch

2023-02-13 Thread Claes Redestad
We can improve various String methods such as `startsWith`, `endsWith` and `regionMatches` by leveraging the intrinsified mismatch methods in `ArraysSupport`. - Commit messages: - Remove overlapping micros, extend testing to endsWith, regionCI and some minor improvements to

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v10]

2023-02-13 Thread Claes Redestad
> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to > copy arrays more efficiently when exactly the whole input array is to be > copied. This helps eliminate range checks and has been verified to help > various String operations. Example: > > Baseline > > Benchmark