Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Alan Bateman
On Tue, 23 Aug 2022 18:57:07 GMT, Сергей Цыпанов wrote: > Suppose we have a scenario where `in` is replaced asynchronously in one of > implementations and the implementation is passed into constructor of > `DataInputStream`. In this case the patched code is less NPE-vulnerable, > isn't it? I

CopyOnWriteArrayList Collection.shuffle

2022-08-23 Thread Zelva Lia
Hello, when shuffling the CopyOnWrite list with the standard Collections.shuffle method, performance anomalies occur, due to the fact that it calls the set method, which copies the array each time, a possible solution (crutch) is a random comparator for sorting, so sorting in COW is redefined to it

Re: RFR: 8288933: Improve the implementation of Double/Float.isInfinite

2022-08-23 Thread Quan Anh Mai
On Wed, 22 Jun 2022 12:43:53 GMT, Quan Anh Mai wrote: > Improve the implementation of `Double/Float.isInfinite` to reduce branching. > Using `>` comparison with `MAX_VALUE` instead of `==` with > `POSITIVE_INFINITY` improves code emission on x86 and produces similar code > for arm. This is als

Re: Proposal: Collection mutability marker interfaces

2022-08-23 Thread Ethan McCue
Ah, I'm an idiot. There is still a proposal here somewhere...maybe. right now non jdk lists can't participate in the special casing? On Tue, Aug 23, 2022, 9:00 PM Paul Sandoz wrote: > List.copyOf already does what you want. > > > https://github.com/openjdk/jdk/blob/master/src/java.base/share/cl

Re: Proposal: Collection mutability marker interfaces

2022-08-23 Thread Paul Sandoz
List.copyOf already does what you want. https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/List.java#L1068 https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/ImmutableCollections.java#L168 Paul. > On Aug 23, 2022, at 4:49 PM, Ethan McCu

Proposal: Collection mutability marker interfaces

2022-08-23 Thread Ethan McCue
Hi all, I am running into an issue with the collections framework where I have to choose between good semantics for users and performance. Specifically I am taking a java.util.List from my users and I need to choose to either * Not defensively copy and expose a potential footgun when I pass that

RFR: 8291660: Grapheme support in BreakIterator

2022-08-23 Thread Naoto Sato
This is to enhance the character break analysis in `java.text.BreakIterator` to conform to the extended grapheme cluster boundaries defined in https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries. A corresponding CSR has also been drafted, as there will be behavioral changes with t

Re: RFR: JDK-8289798: Update to use jtreg 7 [v5]

2022-08-23 Thread Magnus Ihse Bursie
On Tue, 23 Aug 2022 11:22:55 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 7. >> >> The primary change is to the `jib-profiles.js` file, which specifies the >> version of jtreg to use, for those systems that rely on this file. In >> addition, the `requiredVer

Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Сергей Цыпанов
On Tue, 23 Aug 2022 17:12:50 GMT, Alan Bateman wrote: > The main thing is to think through the implications for async close where the > close method replaces 'in'. Suppose we have a scenario where `in` is replaced asynchronously in one of implementations and the implementation is passed into c

Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Alan Bateman
On Tue, 23 Aug 2022 15:50:56 GMT, Daniel Fuchs wrote: > But assuming I've reverted the changes that are dubious, how could there be > bugs caused by replacement of multiple reads with a single one? I was sure > that such replacement improves thread safety as soon as we rid racy reads. The main

Re: RFR: 8292407: Improve Weak CAS VarHandle/Unsafe tests resilience under spurious failures [v5]

2022-08-23 Thread Aleksey Shipilev
> We have a few reports that existing Weak* VarHandle tests are still flaky, > for example on large AArch64 machines or small RISC-V machines. > > The flakiness is intrinsic to the nature of Weak* operations under tests, > that can spuriously fail. The last attempt to fix these was > [JDK-81557

Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Daniel Fuchs
On Tue, 23 Aug 2022 14:31:26 GMT, Сергей Цыпанов wrote: > > I agree that caution is warranted > > But assuming I've reverted the changes that are dubious, how could there be > bugs caused by replacement of multiple reads with a single one? I was sure > that such replacement improves thread saf

Integrated: 8276651: java/lang/ProcessHandle tests fail with "RuntimeException: Input/output error" in java.lang.ProcessHandleImpl$Info.info0

2022-08-23 Thread Roger Riggs
On Fri, 19 Aug 2022 17:05:38 GMT, Roger Riggs wrote: > On Mac OS X on aarch64, the timing of the sysctl vs the process life (pid) > can be such that the sysctl returns EIO. > The native implementation is modified to treat EIO the same as EINVAL, > leaving the information to be returned empty. >

Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Сергей Цыпанов
On Tue, 23 Aug 2022 13:57:35 GMT, Daniel Fuchs wrote: > I agree that caution is warranted But assuming I've reverted the changes that are dubious, how could there be bugs caused by replacement of multiple reads with a single one? I was sure that such replacement improves thread safety as soon

Re: RFR: 8292698: Improve performance of DataInputStream

2022-08-23 Thread Daniel Fuchs
On Sun, 21 Aug 2022 07:21:08 GMT, Alan Bateman wrote: > 'in' is a protected field so it requires thinking about subclasses that might > change 'in', say when the input stream is asynchronously closed. > BufferedInputStream is an example of a FilterInputStream that sets 'in' to > null when asyn

Re: RFR: 8276651: java/lang/ProcessHandle/InfoTest.java failed with "RuntimeException: Input/output error"

2022-08-23 Thread Alan Bateman
On Fri, 19 Aug 2022 17:05:38 GMT, Roger Riggs wrote: > On Mac OS X on aarch64, the timing of the sysctl vs the process life (pid) > can be such that the sysctl returns EIO. > The native implementation is modified to treat EIO the same as EINVAL, > leaving the information to be returned empty. >

Re: RFR: JDK-8289798: Update to use jtreg 7 [v5]

2022-08-23 Thread Christian Stein
> Please review the change to update to using jtreg 7. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the `requiredVersion` has been updated in the various `TEST.ROOT` > files. Chr

Re: RFR: 8292407: Improve Weak CAS VarHandle/Unsafe tests resilience under spurious failures [v4]

2022-08-23 Thread Martin Doerr
On Fri, 19 Aug 2022 18:14:16 GMT, Aleksey Shipilev wrote: >> We have a few reports that existing Weak* VarHandle tests are still flaky, >> for example on large AArch64 machines or small RISC-V machines. >> >> The flakiness is intrinsic to the nature of Weak* operations under tests, >> that can

Re: RFR: JDK-8289798: Update to use jtreg 7 [v4]

2022-08-23 Thread Christian Stein
> Please review the change to update to using jtreg 7. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the `requiredVersion` has been updated in the various `TEST.ROOT` > files. Chr

Re: RFR: JDK-8289798: Update to use jtreg 7 [v3]

2022-08-23 Thread Christian Stein
> Please review the change to update to using jtreg 7. > > The primary change is to the `jib-profiles.js` file, which specifies the > version of jtreg to use, for those systems that rely on this file. In > addition, the `requiredVersion` has been updated in the various `TEST.ROOT` > files. Chr