Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2022-04-13 Thread Alan Bateman
On Thu, 14 Apr 2022 01:40:50 GMT, Brian Burkhalter wrote: > Modify native multi-byte read-write code used by the `java.io` classes to > limit the size of the allocated native buffer thereby decreasing off-heap > memory footprint and increasing throughput. src/java.base/share/native/libjava/io_

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2022-04-13 Thread Daniel Jeliński
On Thu, 14 Apr 2022 01:40:50 GMT, Brian Burkhalter wrote: > Modify native multi-byte read-write code used by the `java.io` classes to > limit the size of the allocated native buffer thereby decreasing off-heap > memory footprint and increasing throughput. The benchmark results are quite unexpe

Re: RFR: 8284638: store skip buffers in InputStream Object

2022-04-13 Thread XenoAmess
On Thu, 14 Apr 2022 02:21:23 GMT, Bernd Eckenfels wrote: > If you consider doing benchmarks in detail maybe consider a static buffer, > too? (Especially if it can be used in multiple implementations?) Why as it already be a unacceptable option for security reason? - PR: https://g

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Joe Wang
On Thu, 14 Apr 2022 01:13:18 GMT, XenoAmess wrote: >> src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java >> line 1819: >> >>> 1817: Map items; >>> 1818: LargeContainer(int size) { >>> 1819: items = HashMap.newHashMap(size*2+1

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Joe Wang
On Thu, 14 Apr 2022 01:15:05 GMT, XenoAmess wrote: >> src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java >> line 171: >> >>> 169: _current = 0; >>> 170: _size = size; >>> 171: _references = HashMap.newHashMap(_size); >> >> Not `_s

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v7]

2022-04-13 Thread Jaikiran Pai
On Wed, 13 Apr 2022 17:42:57 GMT, Volker Simonis wrote: >> Add an API note to `InflaterInputStream::read(byte[] b, int off, int len)` >> to highlight that it might write more bytes than the returned number of >> inflated bytes into the buffer `b`. >> >> The superclass `java.io.InputStream` sp

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Bernd Eckenfels
If you consider doing benchmarks in detail maybe consider a static buffer, too? (Especially if it can be used in multiple implementations?) Gruss Bernd -- http://bernd.eckenfels.net Von: core-libs-dev im Auftrag von XenoAmess Gesendet: Wednesday, April 13, 2022

Re: RFR: 8282274: Compiler implementation for Pattern Matching for switch (Third Preview) [v3]

2022-04-13 Thread Vicente Romero
On Tue, 12 Apr 2022 13:18:14 GMT, Jan Lahoda wrote: >> This is a (preliminary) patch for javac implementation for the third preview >> of pattern matching for switch (type patterns in switches). >> >> Draft JLS: >> http://cr.openjdk.java.net/~gbierman/PatternSwitchPlusRecordPatterns/PatternSwit

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2022-04-13 Thread Brian Burkhalter
On Thu, 14 Apr 2022 01:40:50 GMT, Brian Burkhalter wrote: > Modify native multi-byte read-write code used by the `java.io` classes to > limit the size of the allocated native buffer thereby decreasing off-heap > memory footprint and increasing throughput. Currently for `java.io.FileInputStream

RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

2022-04-13 Thread Brian Burkhalter
Modify native multi-byte read-write code used by the `java.io` classes to limit the size of the allocated native buffer thereby decreasing off-heap memory footprint and increasing throughput. - Commit messages: - 6478546: FileInputStream.read() throws OutOfMemoryError when there is

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 22:57:33 GMT, Stuart Marks wrote: > Not `_size+2` ? I don't have a idea here why he original use the + 2. Is there any guy more familiar with this code tell me why? Thanks! > I suspect the `size*2+1` was a failed attempt at allocating a HashMap of the > correct capacity for

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 23:48:06 GMT, Stuart Marks wrote: > but I suspect the cleanup may simply be removing them entirely. +1 for removing it. - PR: https://git.openjdk.java.net/jdk/pull/7928

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 20:06:34 GMT, Naoto Sato wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in: >> src/java.desktop >> src/java.management >> src/jdk.internal.vm.ci >> src/jdk.jfr >> src/jdk.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.base/unix/classes/java/lang/ProcessEnvironmen

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.xml/share/classes/com/sun/org/apache/xerces/i

Re: RFR: 8284638: store skip buffers in InputStream Object [v4]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 21:58:06 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add jmh test/micro/o

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.xml/share/classes/com/sun/org/apache/xalan/in

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 22:40:38 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update LastModified > > src/java.base/share/classes/java/lang/Character.java line 8574: > >> 8572: private static

Re: RFR: 8284853: Fix varios 'expected' typo

2022-04-13 Thread Chris Plummer
On Wed, 13 Apr 2022 20:36:48 GMT, Andrey Turbanov wrote: > Found various typos of expected: `exepected`, `exept`, `epectedly`, > `expeced`, `Unexpeted`, etc. test/jdk/java/lang/StackWalker/StackStreamTest.java line 218: > 216: private static void equalsOrThrow(String label, List list, >

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.base/share/classes/java/lang/Character.java l

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 20:06:34 GMT, Naoto Sato wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in: >> src/java.desktop >> src/java.management >> src/jdk.internal.vm.ci >> src/jdk.jfr >> src/jdk.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: update LastModified - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java.n

Re: RFR: 8284853: Fix varios 'expected' typo

2022-04-13 Thread Brian Burkhalter
On Wed, 13 Apr 2022 20:36:48 GMT, Andrey Turbanov wrote: > Found various typos of expected: `exepected`, `exept`, `epectedly`, > `expeced`, `Unexpeted`, etc. Expect the Unexpeted. - Marked as reviewed by bpb (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/8231

Re: RFR: 8186958: Need method to create pre-sized HashMap [v17]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: Copyright latest year to 2022 - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.open

Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v6]

2022-04-13 Thread Naoto Sato
> Supporting `IsoFields` temporal fields in chronologies that are similar to > ISO chronology. Corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Modified class desc of `IsoFields` -

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 16:02:10 GMT, Alan Bateman wrote: >>> @AlanBateman You are correct about this. But I wonder if this be a problem, >>> why Reader class can afford store a skip buffer for each Reader. >>> >>> Is there anything different in the situations about skipBuffer in Reader >>> and In

Re: RFR: 8284638: store skip buffers in InputStream Object [v4]

2022-04-13 Thread XenoAmess
> @jmehrens what about this then? > I think it safe now(actually this mechanism is learned from Reader) XenoAmess has updated the pull request incrementally with one additional commit since the last revision: add jmh - Changes: - all: https://git.openjdk.java.net/jdk/pull/5872/

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v29]

2022-04-13 Thread Maurizio Cimadamore
> This PR contains the API and implementation changes for JEP-424 [1]. A more > detailed description of such changes, to avoid repetitions during the review > process, is included as a separate comment. > > [1] - https://openjdk.java.net/jeps/424 Maurizio Cimadamore has updated the pull request

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v28]

2022-04-13 Thread Maurizio Cimadamore
> This PR contains the API and implementation changes for JEP-424 [1]. A more > detailed description of such changes, to avoid repetitions during the review > process, is included as a separate comment. > > [1] - https://openjdk.java.net/jeps/424 Maurizio Cimadamore has updated the pull request

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v27]

2022-04-13 Thread Maurizio Cimadamore
On Wed, 13 Apr 2022 16:12:31 GMT, Alan Bateman wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add @ForceInline annotation on session accessor >> Beef up UnrolledAccess benchmark > > src/java.base/share/cl

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Lance Andersen
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v17]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 21:12:40 GMT, ExE Boss wrote: >> Joe Darcy has updated the pull request with a new target base due to a merge >> or a rebase. The incremental webrev excludes the unrelated changes brought >> in by the merge/rebase. The pull request contains 26 additional commits >> since th

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v17]

2022-04-13 Thread ExE Boss
On Sat, 5 Mar 2022 19:54:44 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >> dist

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Joe Wang
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

RFR: 8284853: Fix varios 'expected' typo

2022-04-13 Thread Andrey Turbanov
Found various typos of expected: `exepected`, `exept`, `epectedly`, `expeced`, `Unexpeted`, etc. - Commit messages: - [PATCH] Fix 'expected' typo - [PATCH] Fix 'expected' typo - [PATCH] Fix 'expected' typo Changes: https://git.openjdk.java.net/jdk/pull/8231/files Webrev: https:/

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v17]

2022-04-13 Thread liach
On Sat, 5 Mar 2022 19:54:44 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >> dist

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v3]

2022-04-13 Thread Volker Simonis
On Sun, 3 Apr 2022 19:04:21 GMT, Alan Bateman wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Extended API-doc based on reviewer feedback > > A suggestion for the structure is to start the new paragraph by saying

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v7]

2022-04-13 Thread Lance Andersen
On Wed, 13 Apr 2022 17:42:57 GMT, Volker Simonis wrote: >> Add an API note to `InflaterInputStream::read(byte[] b, int off, int len)` >> to highlight that it might write more bytes than the returned number of >> inflated bytes into the buffer `b`. >> >> The superclass `java.io.InputStream` sp

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v6]

2022-04-13 Thread Volker Simonis
On Tue, 12 Apr 2022 18:12:03 GMT, Lance Andersen wrote: >> Volker Simonis has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Adapted wording based on @AlanBateman's review, removed implementation >> note on ZipFile::getInputStream and alig

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v7]

2022-04-13 Thread Volker Simonis
> Add an API note to `InflaterInputStream::read(byte[] b, int off, int len)` to > highlight that it might write more bytes than the returned number of > inflated bytes into the buffer `b`. > > The superclass `java.io.InputStream` specifies that `read(byte[] b, int off, > int len)` will leave t

Re: RFR: 8186958: Need method to create pre-sized HashMap [v14]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 04:24:41 GMT, Stuart Marks wrote: > I've done some work on add test cases for these new static factory methods, > and I've also added API notes to the capacity-based constructors to link to > the new factory methods. Note that even though these are javadoc changes, the > AP

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: revert changes in: src/java.desktop src/java.management src/jdk.internal.vm.ci src/jdk.jfr src/jdk.management.jfr src/jdk.mana

Re: RFR: 8282191: Implementation of Foreign Function & Memory API (Preview) [v27]

2022-04-13 Thread Alan Bateman
On Tue, 12 Apr 2022 10:24:47 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-424 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: 8186958: Need method to create pre-sized HashMap [v15]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with three additional commits since the last revision: - Add apiNote to appropriate constructors of HM, LHM, and WHM. - Add test cases for static factory methods. - Minor adjustment to test

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread Roger Riggs
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Alan Bateman
On Wed, 13 Apr 2022 15:03:22 GMT, Alan Bateman wrote: >> This change may be problematic for servers with a large number connections >> and an input stream for each connection. It could add up to 2k to the >> footprint of each connection when skip is used. > >> @AlanBateman You are correct abou

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 15:23:16 GMT, XenoAmess wrote: > > On a side note for unifying the skip buffer implementation of reader vs > > input stream: For the input stream subclasses in the JDK that have their > > own skip with buffering logic (as described in > > https://github.com/openjdk/jdk/pull

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 15:20:06 GMT, liach wrote: > On a side note for unifying the skip buffer implementation of reader vs input > stream: For the input stream subclasses in the JDK that have their own skip > with buffering logic (as described in > https://github.com/openjdk/jdk/pull/5872#discus

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > moving nr declaration

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Roger Riggs
On Wed, 13 Apr 2022 15:03:22 GMT, Alan Bateman wrote: >> This change may be problematic for servers with a large number connections >> and an input stream for each connection. It could add up to 2k to the >> footprint of each connection when skip is used. > >> @AlanBateman You are correct abou

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 15:03:22 GMT, Alan Bateman wrote: > > @AlanBateman You are correct about this. But I wonder if this be a problem, > > why Reader class can afford store a skip buffer for each Reader. > > Is there anything different in the situations about skipBuffer in Reader > > and InputSt

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Roger Riggs
On Wed, 13 Apr 2022 14:52:20 GMT, XenoAmess wrote: >> It indeed is reallocated when the existing one is not large enough. > >> I recommend moving `nr` declaration from the beginning of the method to >> where it's actually used (here) > > @liach done. Sorry, I misunderstood your earlier comment

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Alan Bateman
On Wed, 13 Apr 2022 14:36:17 GMT, Alan Bateman wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add MIN_SKIP_BUFFER_SIZE > > This change may be problematic for servers with a large number connections > and an input s

Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-13 Thread Alan Bateman
On Wed, 13 Apr 2022 11:38:55 GMT, ExE Boss wrote: >> Thanks - the same issue appears with `BufferedWriter`/`Writer`. > > The solution is to add the `private` constructor: > > private Reader(Object fallbackLock, Void internal) { > // assert fallbackLock != null; >

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 14:51:34 GMT, liach wrote: >> The check for `skipBuffer.length < size` makes it appear that the buffer can >> be re-allocated. >> If it is allocated once then only the `skipBuffer == null` is needed. >> >> The code may be simpler if the 'size' variable is removed. >> >>

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread liach
On Wed, 13 Apr 2022 14:45:31 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/io/InputStream.java line 557: >> >>> 555: >>> 556: while (remaining > 0) { >>> 557: nr = read(skipBuffer, 0, (int)Math.min(size, remaining)); >> >> I recommend moving `nr` declaration f

Re: RFR: 8284638: store skip buffers in InputStream Object [v3]

2022-04-13 Thread XenoAmess
> @jmehrens what about this then? > I think it safe now(actually this mechanism is learned from Reader) XenoAmess has updated the pull request incrementally with one additional commit since the last revision: moving nr declaration from the beginning of the method to where it's actually used

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Roger Riggs
On Tue, 12 Apr 2022 23:13:26 GMT, liach wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add MIN_SKIP_BUFFER_SIZE > > src/java.base/share/classes/java/io/InputStream.java line 557: > >> 555: >> 556: while (re

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 14:36:17 GMT, Alan Bateman wrote: > This change may be problematic for servers with a large number connections > and an input stream for each connection. It could add up to 2k to the > footprint of each connection when skip is used. @AlanBateman You are correct about this.

Re: RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v6]

2022-04-13 Thread Alan Bateman
On Tue, 12 Apr 2022 15:00:29 GMT, Volker Simonis wrote: >> Add an API note to `InflaterInputStream::read(byte[] b, int off, int len)` >> to highlight that it might write more bytes than the returned number of >> inflated bytes into the buffer `b`. >> >> The superclass `java.io.InputStream` sp

Re: RFR: 8284638: store skip buffers in InputStream Object [v2]

2022-04-13 Thread Alan Bateman
On Tue, 12 Apr 2022 22:19:18 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add MIN_SKIP_BUFFER_S

Re: RFR: 8284642: Unexpected behavior of -XX:MaxDirectMemorySize=0

2022-04-13 Thread Thomas Stuefe
On Wed, 13 Apr 2022 12:24:46 GMT, Harold Seigel wrote: > Please review this small fix for JDK-8284642. The fix was tested by running > Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux > x64. Additionally, the modified test and the test in the bug report were run >

Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-13 Thread Alan Bateman
On Wed, 13 Apr 2022 11:35:33 GMT, ExE Boss wrote: > Actually, we can’t in case `InternalLock.CAN_USE_INTERNAL_LOCK` is ever  > `false` That's right, both StreamEncoder and StreamDecoder need the both cases. - PR: https://git.openjdk.java.net/jdk/pull/8166

Re: RFR: 8284161: Implementation of Virtual Threads (Preview) [v2]

2022-04-13 Thread Alan Bateman
> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which > JDK version to target. > > We will refresh this PR periodically to pick up changes and fixes from the > loom repo. > > Most of the new mechanisms in the HotSpot VM are disabled by default and > require running with

Re: RFR: 8284642: Unexpected behavior of -XX:MaxDirectMemorySize=0

2022-04-13 Thread Alan Bateman
On Wed, 13 Apr 2022 12:24:46 GMT, Harold Seigel wrote: > Please review this small fix for JDK-8284642. The fix was tested by running > Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux > x64. Additionally, the modified test and the test in the bug report were run >

Re: RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v9]

2022-04-13 Thread Claes Redestad
On Thu, 7 Apr 2022 07:01:23 GMT, Ludovic Henry wrote: >> Despite the hash value being cached for Strings, computing the hash still >> represents a significant CPU usage for applications handling lots of text. >> >> Even though it would be generally better to do it through an enhancement to >>

Re: RFR: 8282274: Compiler implementation for Pattern Matching for switch (Third Preview) [v3]

2022-04-13 Thread Aggelos Biboudis
On Tue, 12 Apr 2022 13:18:14 GMT, Jan Lahoda wrote: >> This is a (preliminary) patch for javac implementation for the third preview >> of pattern matching for switch (type patterns in switches). >> >> Draft JLS: >> http://cr.openjdk.java.net/~gbierman/PatternSwitchPlusRecordPatterns/PatternSwit

Re: RFR: 8284642: Unexpected behavior of -XX:MaxDirectMemorySize=0

2022-04-13 Thread Thomas Stuefe
On Wed, 13 Apr 2022 12:24:46 GMT, Harold Seigel wrote: > Please review this small fix for JDK-8284642. The fix was tested by running > Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux > x64. Additionally, the modified test and the test in the bug report were run >

RFR: 8284642: Unexpected behavior of -XX:MaxDirectMemorySize=0

2022-04-13 Thread Harold Seigel
Please review this small fix for JDK-8284642. The fix was tested by running Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux x64. Additionally, the modified test and the test in the bug report were run locally. Thanks, Harold - Commit messages: - 8284

Re: RFR: 8284161: Implementation of Virtual Threads (Preview)

2022-04-13 Thread Alan Bateman
On Tue, 12 Apr 2022 16:49:41 GMT, Daniel Jeliński wrote: > If it was, please update the javadoc - `NANOSECONDS.toMillis(-1)` = 0 implies > no waiting in Net.poll It's benign for the current usages but you are right, it was not intentional. - PR: https://git.openjdk.java.net/jdk/pu

Re: RFR: 8284161: Implementation of Virtual Threads (Preview)

2022-04-13 Thread ExE Boss
On Tue, 12 Apr 2022 19:09:32 GMT, Daniel Jeliński wrote: >> This is the implementation of JEP 425: Virtual Threads (Preview); TBD which >> JDK version to target. >> >> We will refresh this PR periodically to pick up changes and fixes from the >> loom repo. >> >> Most of the new mechanisms in

Re: RFR: 8284161: Implementation of Virtual Threads (Preview)

2022-04-13 Thread ExE Boss
On Wed, 13 Apr 2022 09:49:04 GMT, Daniel Fuchs wrote: >>> Not sure if that even matters - but there will be a slight change of >>> behaviour here if `InternalLock.CAN_USE_INTERNAL_LOCK` is ever `false`. >>> Instead of synchronizing on `in`, the `BufferedReader` will synchronize on >>> `this`.

Re: RFR: 8275535: Retrying a failed authentication on multiple LDAP servers can lead to users blocked

2022-04-13 Thread Carsten Madsen
On Wed, 20 Oct 2021 13:35:22 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8275535. This fix reverts the behavior to > the state previous to JDK-8160768, where an authentication failure stops from > trying other LDAP servers with the same credentials [1]. After JDK-8160768 we >

Re: RFR: 8283994: Make Xerces DatatypeException stackless [v2]

2022-04-13 Thread Jaikiran Pai
On Wed, 13 Apr 2022 08:30:33 GMT, Aleksey Shipilev wrote: >>> Hello @shipilev, do you think this stackless nature of this specific >>> `DatatypeException` type should be noted in its javadoc, just to avoid any >>> surprises when someone in future ends up using this exception type as the >>> "c

Re: RFR: 8283994: Make Xerces DatatypeException stackless [v2]

2022-04-13 Thread Jaikiran Pai
On Thu, 31 Mar 2022 17:54:28 GMT, Aleksey Shipilev wrote: >> See bug report for more details. This change improves >> SPECjvm2008:xml.validation for about +3%: >> >> >> baseline: 298.353 ± 1.008 ops/min >> patched: 309.912 ± 1.347 ops/min >> >> Of course, the real improvements might be e

Re: RFR: 8284161: Implementation of Virtual Threads (Preview)

2022-04-13 Thread Daniel Fuchs
On Tue, 12 Apr 2022 13:02:44 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/io/BufferedReader.java line 101: >> >>> 99: */ >>> 100: public BufferedReader(Reader in, int sz) { >>> 101: Objects.requireNonNull(in); >> >> Not sure if that even matters - but there will

Re: RFR: 8283994: Make Xerces DatatypeException stackless [v2]

2022-04-13 Thread Aleksey Shipilev
On Wed, 6 Apr 2022 07:48:04 GMT, Aleksey Shipilev wrote: >> Any other reviews? I would like someone else to confirm my investigation >> that we don't use the stack traces out of these exceptions too... > >> Hello @shipilev, do you think this stackless nature of this specific >> `DatatypeExcepti

Integrated: 8284579: Improve VarHandle checks for interpreter

2022-04-13 Thread Claes Redestad
On Fri, 8 Apr 2022 11:48:10 GMT, Claes Redestad wrote: > A few additional enhancements aiming to improve VH performance in the > interpreter: > > - Flatten `TypeAndInvokers`: adds a pointer to `VarHandle` (a small increase > 40->48) but removes an object and an indirection on any instance actu