RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-02-21 Thread Mike Duigou
Hello all; This changeset consists of two small performance improvements for ArrayList. Both are related to the lazy initialization introduced in JDK-8011200. The first change is in the ArrayList(int capacity) constructor and forces lazy initialization if the requested capacity is zero. It's be

RFR: 8035584 : (s) ArrayList(c) should avoid inflation if c is empty

2014-04-23 Thread Mike Duigou
Hello all; Revisiting this issue again at long last I have updated the proposed changeset based upon Jason Mehren's most recent feedback. http://cr.openjdk.java.net/~mduigou/JDK-8035584/4/webrev/ This version reverts the prior changes to toArray(). Mike

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-11 Thread Mike Duigou
On Mar 11 2014, at 17:42 , Martin Buchholz wrote: > I'm hoping y'all have evidence that empty ArrayLists are common in the wild. Yes, certainly. From the original proposal: > [This change] based upon analysis that shows that in large applications as > much as 10% of maps and lists are initializ

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-11 Thread Mike Duigou
I've actually always used scp. :-) Since I accepted all of your changes as suggested and had no other changes I was just going to go ahead and push once testing was done. I've now prepared a revised webrev and can still accept feedback. http://cr.openjdk.java.net/~mduigou/JDK-8035584/1/webrev/

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-11 Thread Mike Duigou
On Feb 21 2014, at 14:56 , Martin Buchholz wrote: > You should do -> code conversion separately, and do it pervasively > across the entire JDK. From your lips to God's ears I keep suggesting this along with a restyle to official style every time we create new repos. Seems unlikely unfort

RE: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-12 Thread Jason Mehrens
isEmpty to return false followed by toArray returning a zero length array that is different from cached copies. Jason > Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is > empty > From: mike.dui...@oracle.com > Date: Tue, 11 Mar 2014 18:18:26 -0700

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-12 Thread Mike Duigou
on > > > Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is > > empty > > From: mike.dui...@oracle.com > > Date: Tue, 11 Mar 2014 18:18:26 -0700 > > To: marti...@google.com > > CC: core-libs-dev@openjdk.java.net > > > > >

RE: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-13 Thread Jason Mehrens
tor of EMPTY_ELEMENTDATA array. When we patched the Collections$EmptyXXX classes we avoided returning a cached empty array for this reason. Jason Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty From: mike.dui...@oracle.com Date: Wed, 12 Mar 2014 12:41:00 -0700

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-03-13 Thread David M. Lloyd
th it as possible. Also it would be possible for isEmpty to return false followed by toArray returning a zero length array that is different from cached copies. Jason Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty From: mike.dui...@oracle.com Date: Tue, 1

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-04-23 Thread Mike Duigou
8757 that were similar to this but those changes for the most part were to sync the javadoc to the longstanding actual behaviour. Mike > > Jason > > Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is > empty > From: mike.dui...@oracle.com > Date: Wed, 12 M

Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty

2014-04-23 Thread Mike Duigou
_ELEMENTDATA array. When we patched the Collections$EmptyXXX > classes we avoided returning a cached empty array for this reason. > > Jason > > Subject: Re: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is > empty > From: mike.dui...@oracle.com > Date: We

RE: RFR: 8035584 : (s) ArrayList(c) should avoid inflation if c is empty

2014-04-25 Thread Jason Mehrens
Looks good to me. Jason > From: mike.dui...@oracle.com > Subject: RFR: 8035584 : (s) ArrayList(c) should avoid inflation if c is empty > Date: Wed, 23 Apr 2014 15:33:48 -0700 > To: core-libs-dev@openjdk.java.net > > Hello all; > > Revisiting this issue again at long

RE: RFR: 8035584: (s) ArrayList(c) should avoid inflation if c is empty - (toArray spec)

2014-04-25 Thread Jason Mehrens
MIke, The inner T.V. lawyer in me has been trying and find some loophole that will allow returning the same empty array from toArray. The spec states "..no references to it are maintained by this collection". The Saul Goodman loophole is that "this collection" implies object membe