Re: flexjs foreach very slow

2016-05-10 Thread Josh Tynjala
Yes, exactly. - Josh On Tue, May 10, 2016 at 3:38 AM, Andy Dufilie wrote: > You're right, it is possible, but I think the key word there was "easily." > :) > > Sent from my Android > On May 9, 2016 23:59, "Alex Harui" wrote: > > > > > > > On 5/9/16, 1:22 PM, "Josh Tynjala" wrote: > > > > >Tha

Re: flexjs foreach very slow

2016-05-10 Thread Andy Dufilie
You're right, it is possible, but I think the key word there was "easily." :) Sent from my Android On May 9, 2016 23:59, "Alex Harui" wrote: > > > On 5/9/16, 1:22 PM, "Josh Tynjala" wrote: > > >That's a good call, Andy. You're absolutely right that a for-each loop > >could also have its own ret

Re: flexjs foreach very slow

2016-05-09 Thread Alex Harui
On 5/9/16, 1:22 PM, "Josh Tynjala" wrote: >That's a good call, Andy. You're absolutely right that a for-each loop >could also have its own return statements that are meant for the >surrounding function. With that in mind, I don't think there's a special >case here that the compiler can easily d

Re: flexjs foreach very slow

2016-05-09 Thread Josh Tynjala
That's a good call, Andy. You're absolutely right that a for-each loop could also have its own return statements that are meant for the surrounding function. With that in mind, I don't think there's a special case here that the compiler can easily detect to optimize. It sounds like you should simpl

Re: flexjs foreach very slow

2016-05-09 Thread Andy Dufilie
There can also be return statements within loops as well as "break to label" or "continue to label". It all seems very messy to me and I still think it should be behind an optimization option. The current implementation works perfectly and I would prefer the JS output to be minimally different fr

Re: flexjs foreach very slow

2016-05-09 Thread Alex Harui
On 5/9/16, 9:37 AM, "Josh Tynjala" wrote: >We might be able to figure out how to use Array.some() instead. Return >false for most iterations of the loop, and then return true when a "break" >is encountered (and return false when "continue" is encountered). >Replacing break and continue could be

Re: flexjs foreach very slow

2016-05-09 Thread Josh Tynjala
e. Looking at > MDN > >>> [1], forEach is widely supported in browsers. Including IE 9. > >>> > >>> > >>> > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_ > >>> Objects/Array/forEach > >>> > >>> -

Re: flexjs foreach very slow

2016-05-08 Thread Harbs
>> On Sat, May 7, 2016 at 4:32 PM, lizhi wrote: >>> >>>> 10x slow. >>>> maybe use the arr.forEach. >>>> pls run this code >>>> >>>> https://gist.github.com/matrix3d/a9765b94ade3d626ad64d16f28deccae >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> >>>> http://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very >>>> -slow-tp52571p52880.html >>>> Sent from the Apache Flex Development mailing list archive at >>>> Nabble.com. >>>> >> >

Re: flexjs foreach very slow

2016-05-08 Thread Alex Harui
rray/forEach >> >> - Josh >> >> On Sat, May 7, 2016 at 4:32 PM, lizhi wrote: >> >>> 10x slow. >>> maybe use the arr.forEach. >>> pls run this code >>> >>> https://gist.github.com/matrix3d/a9765b94ade3d626ad64d16f28deccae >&

Re: flexjs foreach very slow

2016-05-08 Thread Harbs
-- >> View this message in context: >> http://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571p52880.html >> Sent from the Apache Flex Development mailing list archive at Nabble.com. >>

Re: flexjs foreach very slow

2016-05-07 Thread Josh Tynjala
low. > maybe use the arr.forEach. > pls run this code > > https://gist.github.com/matrix3d/a9765b94ade3d626ad64d16f28deccae > > > > -- > View this message in context: > http://apache-flex-development.2333347.n4.nabble.com/flexjs-foreach-very-slow-tp52571p52880

Re: flexjs foreach very slow

2016-05-07 Thread lizhi
10x slow. maybe use the arr.forEach. pls run this code https://gist.github.com/matrix3d/a9765b94ade3d626ad64d16f28deccae -- View this message in context: http://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571p52880.html Sent from the Apache Flex Development

Re: flexjs foreach very slow

2016-05-07 Thread Josh Tynjala
I agree with Andy. The default behavior should remain syntax sugar on top of for-in. - Josh On Sat, May 7, 2016 at 11:38 AM, Andy Dufilie wrote: > If you do make this change it should be an optional compiler argument, > because this changes the behavior of the code. The following loop should >

Re: flexjs foreach very slow

2016-05-07 Thread Andy Dufilie
If you do make this change it should be an optional compiler argument, because this changes the behavior of the code. The following loop should print 1 and 2, not undefined: var array = []; array[2] = 1; array[4] = 2; for each (var x in array) trace(x); On May 7, 2016 10:18 AM, "Alex Harui"

Re: flexjs foreach very slow

2016-05-07 Thread Alex Harui
On 5/7/16, 1:32 AM, "lizhi" wrote: >must ded the type. >if(Array){ > for(var i=0;i}else{ > for in >} Should be doable. How much faster is it? Please file a pull request or JIRA so we don't forget this issue. Thanks, -Alex

Re: flexjs foreach very slow

2016-05-07 Thread lizhi
must ded the type. if(Array){ for(var i=0;ihttp://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571p52864.html Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs foreach very slow

2016-04-25 Thread Josh Tynjala
>> { > >> }} > >> > >> //more fast code > >> var len=this.ss.length; > >> for(var i=0;i >> var s = this.ss[i]; > >> } > >> > >> > >> > >> -- > >> View this message in context: > >> > http://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571.html > >> Sent from the Apache Flex Development mailing list archive at > Nabble.com. > >> > >

Re: flexjs foreach very slow

2016-04-25 Thread Harbs
> }} >> >> //more fast code >> var len=this.ss.length; >> for(var i=0;i> var s = this.ss[i]; >> } >> >> >> >> -- >> View this message in context: >> http://apache-flex-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571.html >> Sent from the Apache Flex Development mailing list archive at Nabble.com. >>

Re: flexjs foreach very slow

2016-04-25 Thread Josh Tynjala
0_target) > { > var s = foreachiter0_target[foreachiter0]; > { > }} > > //more fast code > var len=this.ss.length; > for(var i=0;i var s = this.ss[i]; > } > > > > -- > View this message in context: > http://apache-flex-development.247.n4.nabble

Re: flexjs foreach very slow

2016-04-25 Thread Harbs
achiter0_target) > { > var s = foreachiter0_target[foreachiter0]; > { > }} > > //more fast code > var len=this.ss.length; > for(var i=0;i var s = this.ss[i]; > } > > > > -- > View this message in context: > http://apache-flex-development

flexjs foreach very slow

2016-04-25 Thread lizhi
-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571.html Sent from the Apache Flex Development mailing list archive at Nabble.com.