Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-18 Thread Paul Sandoz
On Mar 17, 2014, at 9:57 PM, Ulf Zibis wrote: > Am 17.03.2014 17:08, schrieb mark.reinh...@oracle.com: >> 2014/3/17 1:41 -0700, paul.san...@oracle.com: >>> On Mar 15, 2014, at 12:17 AM, Ulf Zibis wrote: ... I more like the given style with less spaces: 3854

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread Ulf Zibis
Am 17.03.2014 17:08, schrieb mark.reinh...@oracle.com: 2014/3/17 1:41 -0700, paul.san...@oracle.com: On Mar 15, 2014, at 12:17 AM, Ulf Zibis wrote: ... I more like the given style with less spaces: 3854 for (int i=0; i Subjectively that irritates my eyes :-) non-subjectively i

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread Ulf Zibis
Am 17.03.2014 17:36, schrieb Paul Sandoz: Hi Sergey, Thanks, you are right! I did not realize it copied the array into a local variable, but that makes sense. Here is the byte code generated by javac (9) for two different methods: . Thanks from me too, this is great work. I floated my q

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread Paul Sandoz
Hi Sergey, Thanks, you are right! I did not realize it copied the array into a local variable, but that makes sense. Here is the byte code generated by javac (9) for two different methods: void x() { for (Object o : a) { System.out.println(o); } } 0

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread mark . reinhold
2014/3/17 1:41 -0700, paul.san...@oracle.com: > On Mar 15, 2014, at 12:17 AM, Ulf Zibis wrote: >> ... >> >> I more like the given style with less spaces: >> 3854 for (int i=0; i> It better visualizes the 3 parts of the for statement. >> > > Subjectively that irritates my eyes :-)

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread Sergey Bylokhov
On 3/17/14 7:41 PM, Paul Sandoz wrote: On Mar 15, 2014, at 12:17 AM, Ulf Zibis wrote: Am 14.03.2014 17:10, schrieb Paul Sandoz: I'm willing to believe for-loop over array is as efficient as fortran-style loop +for (E e : a) { +action.accept(e); +} Ye

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-17 Thread Paul Sandoz
On Mar 15, 2014, at 12:17 AM, Ulf Zibis wrote: > Am 14.03.2014 17:10, schrieb Paul Sandoz: >>> I'm willing to believe for-loop over array is as efficient as fortran-style >>> loop >>> >>> +for (E e : a) { >>> +action.accept(e); >>> +} >>> >> Yeah, i pre

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Ulf Zibis
Am 14.03.2014 17:10, schrieb Paul Sandoz: I'm willing to believe for-loop over array is as efficient as fortran-style loop +for (E e : a) { +action.accept(e); +} Yeah, i previously went through a whole bunch of code replacing such fortran-style loops wi

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Mike Duigou
Looks good to me. There are some additional optimization opportunities but they can certainly wait. Mike On Mar 14 2014, at 05:04 , Paul Sandoz wrote: > Hi, > > This patch overrides some default methods with more optimal ones for the > Arrays.asList implementation: > > > http://cr.openjdk

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Mike Duigou
Looks good to me. There are some additional optimization opportunities but they can certainly wait. Mike On Mar 14 2014, at 05:04 , Paul Sandoz wrote: > Hi, > > This patch overrides some default methods with more optimal ones for the > Arrays.asList implementation: > > > http://cr.openjdk

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Paul Sandoz
On Mar 14, 2014, at 4:46 PM, Martin Buchholz wrote: > Looks good to me. > Thanks. > I'm willing to believe for-loop over array is as efficient as fortran-style > loop > > +for (E e : a) { > +action.accept(e); > +} > Yeah, i previously went through

Re: RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Alan Bateman
On 14/03/2014 12:04, Paul Sandoz wrote: Hi, This patch overrides some default methods with more optimal ones for the Arrays.asList implementation: http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8037106-arrays.asList.forEach/webrev/ It required some surgical work on tests to shove in the Arr

RFR 8037106: Optimize Arrays.asList(...).forEach

2014-03-14 Thread Paul Sandoz
Hi, This patch overrides some default methods with more optimal ones for the Arrays.asList implementation: http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8037106-arrays.asList.forEach/webrev/ It required some surgical work on tests to shove in the Arrays.asList test case, since it is a factor