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 last I have updated the proposed

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 member

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

2014-04-23 Thread Mike Duigou
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 Mar 2014 12:41:00 -0700 CC: marti...@google.com; core-libs-dev@openjdk.java.net To: jason_mehr...@hotmail.com

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

2014-04-23 Thread Mike Duigou
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 CC: marti...@google.com; core-libs-dev@openjdk.java.net To: jason_mehr

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-13 Thread Jason Mehrens
. 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 CC: marti...@google.com; core

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

2014-03-13 Thread David M. Lloyd
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, 11 Mar 2014 18:18:26 -0700

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

2014-03-12 Thread Jason Mehrens
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, 11 Mar 2014 18:18:26 -0700 To: marti...@google.com

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

2014-03-12 Thread Mike Duigou
: 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 On Mar 11 2014, at 17:42 , Martin Buchholz marti...@google.com wrote: I'm hoping y'all have

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 marti...@google.com 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

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 marti...@google.com wrote: You should do tt - 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.

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