Re: RFR (S): 8215472: Cleanups in implementation classes of jdk.zipfs and tests

2018-12-18 Thread Xueming Shen
On 12/18/18 5:44 AM, Langer, Christoph wrote: In ZipFileSystem you remove the unused method releaseDeflater - to me this indicates the resource pooling is actually broken? I.e., shouldn't EntryOutputStreamDef return its Deflater to the cache when it's closed, similar to how the anonymous Infl

Re: JDK-8210280 - Unnecessary reallocation when invoking HashMap.putAll()

2018-12-18 Thread Michal Vala
Randomized test is not deterministic now. Can we have also original one? On 12/18/18 10:29 PM, Martin Buchholz wrote: We have changes in jsr166 CVS ready for going into openjdk https://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/HashMap-resize/index.html (except for the microbenc

Re: RFR(XS): 8215009: GCC 8 compilation eror in libjli

2018-12-18 Thread David Holmes
On 19/12/2018 1:56 am, Dmitry Chuyko wrote: On 12/18/18 3:39 AM, David Holmes wrote: On 11/12/2018 9:30 pm, Dmitry Chuyko wrote: On 12/11/18 4:03 AM, David Holmes wrote: Hi Dmitry, On 11/12/2018 12:16 am, Dmitry Chuyko wrote: Hello, Please review a small fix in java_md_solinux.c: continuati

Re: RFR: JDK-8066619: String(byte[],int,int,int) in String has been deprecated in Manifest and Attributes

2018-12-18 Thread Philipp Kunz
now with assertThrows. Find a new patch attached. On Tue, 2018-12-18 at 13:38 -0800, Martin Buchholz wrote: > On Tue, Dec 18, 2018 at 1:13 PM Lance Andersen .com> > wrote: > > > > > Is there a reason you did not use > > > > @Test(expectedExceptions = IOException.class) > > > > It just seems to

Re: RFR: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship

2018-12-18 Thread David Holmes
Looks good. Thanks for fixing this Daniel! David On 19/12/2018 12:57 am, Daniel Fuchs wrote: Hi, Please find below a fix for: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship https://bugs.openjdk.java.net/browse/JDK-82

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Jason Mehrens
>Sorry for not having remembered the history. **Start the wavy motion effect because we are going back in time! == Date: Wed, 27 Sep 2006 16:49:47 -0700 From: Martin Buchholz Subject: 6347106 (coll) Make ArrayList(Collection) more threadsafe Sender: To: Jason Mehrens Hi Jason, Thanks for

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Martin Buchholz
Sorry for not having remembered the history. Having ArrayList(Collection) delegate to toArray was done for performance and robustness. We don't want to change the "trimming" behavior of collection copying, because trimming by copying is a common idiom (we never added trimming methods to all the col

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Stuart Marks
On 12/18/18 1:49 PM, Jason Mehrens wrote: The reason the patched code is faster is because it will avoid an array resize that is triggered in the benchmark by: "// once a new ArrayList is created add a new element al.add(new Integer(900));" http://cr.openjdk.java.net/~sgroeger/perf

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Stuart Marks
On 12/18/18 9:23 AM, Martin Buchholz wrote: The blessed solution to the list copy problem is probably List.copyOf https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html#copyOf(java.util.Collection) which might do the optimization you're hoping for. List.copyOf is fine,

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Jason Mehrens
The reason the patched code is faster is because it will avoid an array resize that is triggered in the benchmark by: "// once a new ArrayList is created add a new element al.add(new Integer(900));" http://cr.openjdk.java.net/~sgroeger/perf/arraylist/ArrayListBenchmark.java If you look

Re: RFR: JDK-8066619: String(byte[],int,int,int) in String has been deprecated in Manifest and Attributes

2018-12-18 Thread Martin Buchholz
On Tue, Dec 18, 2018 at 1:13 PM Lance Andersen wrote: > > > Is there a reason you did not use > > @Test(expectedExceptions = IOException.class) > > It just seems to make the test a bit more readable > > That construct has lost popularity over the past decade, sort of like inheritance is no longer

Re: JDK-8210280 - Unnecessary reallocation when invoking HashMap.putAll()

2018-12-18 Thread Martin Buchholz
We have changes in jsr166 CVS ready for going into openjdk https://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/HashMap-resize/index.html (except for the microbenchmark, which doesn't fit into our pipeline at the moment). Pardon the fiddling ... --- Let's check in this order: +

Re: RFR: JDK-8066619: String(byte[],int,int,int) in String has been deprecated in Manifest and Attributes

2018-12-18 Thread Lance Andersen
Hi Philipp, A question as to why for tests such as: ——— @Test public void testMainAttributesHeaderNameEmpty() throws Exception { Manifest mf = new Manifest(); mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0"); mf.getMainAttributes().put(EMPTY_NAME, SOME

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Scott Palmer
> On Dec 18, 2018, at 12:58 PM, Jason Mehrens wrote: > > Hi Steve, > >> ArrayList has a constructor which takes an arbitrary Collection as a >> parameter. This constructor will create an iterator over the collection >> ;and it will add each entry returned to the ArrayList. > >> We have fou

Re: 8183912: java.math.BigDecimal.movePointLeft() should return this if called with zero argument

2018-12-18 Thread Roger Riggs
+1, Hard to argue with +10x.  :) Roger On 12/18/2018 01:03 PM, Brian Burkhalter wrote: https://bugs.openjdk.java.net/browse/JDK-8183912 For the patch included below, the JMH benchmark MovePointLeftZero attached to the above issue, when run

8183912: java.math.BigDecimal.movePointLeft() should return this if called with zero argument

2018-12-18 Thread Brian Burkhalter
https://bugs.openjdk.java.net/browse/JDK-8183912 For the patch included below, the JMH benchmark MovePointLeftZero attached to the above issue, when run with options "-f 1 -wi 5 -w 5 -i 10 -r 10" (one fork, five warmup iterations of five second

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Jason Mehrens
Hi Steve, >ArrayList has a constructor which takes an arbitrary Collection as a >parameter. This constructor will create an iterator over the collection >;and it will add each entry returned to the ArrayList. >We have found that quite a lot of the time the object passed as a >parameter is in

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Alan Bateman
On 18/12/2018 16:44, Steve Groeger wrote: Hi all, I am proposing an enhancement to ArrayList.java to improve its performance. ArrayList has a constructor which takes an arbitrary Collection as a parameter. This constructor will create an iterator over the collection and it will add each entry r

Re: Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Martin Buchholz
This is no question that we can optimize the case of ArrayList -> ArrayList, but what about all the other Collection implementations? ArrayDeque and CopyOnWriteArrayList come to mind. ArrayList is a popular class to use for making copies of Collections. Where do you stop? A pathological subclass

Re: RFR: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship

2018-12-18 Thread Mandy Chung
On 12/18/18 6:57 AM, Daniel Fuchs wrote: Hi, Please find below a fix for: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship https://bugs.openjdk.java.net/browse/JDK-8213402 webrev: http://cr.openjdk.java.net/~dfuchs/we

Proposal: ArrayList constructor perforrmance improvement

2018-12-18 Thread Steve Groeger
Hi all, I am proposing an enhancement to ArrayList.java to improve its performance. ArrayList has a constructor which takes an arbitrary Collection as a parameter. This constructor will create an iterator over the collection and it will add each entry returned to the ArrayList. We have foun

Re: RFR(XS): 8215009: GCC 8 compilation eror in libjli

2018-12-18 Thread Dmitry Chuyko
On 12/18/18 3:39 AM, David Holmes wrote: On 11/12/2018 9:30 pm, Dmitry Chuyko wrote: On 12/11/18 4:03 AM, David Holmes wrote: Hi Dmitry, On 11/12/2018 12:16 am, Dmitry Chuyko wrote: Hello, Please review a small fix in java_md_solinux.c: continuation is not truly compatible with pthread_crea

Re: Adding Path-based constructors to various classes

2018-12-18 Thread Kasper Nielsen
Hi, I don't know if it makes sense at this time. But if File and Path had both implemented CharSequence. We could just accept a CharSequence for every method that needs a path/file. Allowing to parse along either a File, Path or String. I've have done myself in some APIs that uses tree-based stru

Re: RFR: JDK-8066619: String(byte[],int,int,int) in String has been deprecated in Manifest and Attributes

2018-12-18 Thread Roger Riggs
Hi Philipp, I'm satisfied with this update. BTW, your workspace may be a bit out of date, the patch did not merge without warnings. For convenience of other reviewers, here a webrev:  http://cr.openjdk.java.net/~rriggs/webrev-8066619-3.patch/ Thanks, Roger On 12/18/2018 02:15 AM, Philipp K

Re: Adding Path-based constructors to various classes

2018-12-18 Thread Jonathan Gibbons
Zip files are now accessible through the zipfs NIO FileSystem provider. -- Jon On 12/17/18 5:00 PM, Brian Burkhalter wrote: Hi Andrew, java.nio.channels.FileChannel pretty much covers RandomAccessFile, I think. The ZipFile case is something else, not really in I/O. Thanks, Brian On Dec 17

RFR: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship

2018-12-18 Thread Daniel Fuchs
Hi, Please find below a fix for: 8213402: [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship https://bugs.openjdk.java.net/browse/JDK-8213402 webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8213402/webrev.01/ These tests use a Cu

RE: RFR (S): 8215472: Cleanups in implementation classes of jdk.zipfs and tests

2018-12-18 Thread Langer, Christoph
Hi Claes, Hi Lance, thanks for reviewing my patch. > I believe the convention in the OpenJDK sources is to sort static > imports after non-static, so changing to the other way around in a few > places adds inconsistencies. I was unaware of this but it seems that's the way most files are structur

RFR 6996807 : FieldReflectorKey hash code computation can be improved

2018-12-18 Thread Ivan Gerasimov
Hello! FieldReflectorKey class contains a combined-string representation of the fields (their names and signatures). This string is used for calculating the hash code and comparing two FieldReflectorKey objects for equality, which is expensive. It is proposed to store the names and signatur