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
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
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
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
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
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
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
> >>>
> >>> -
>> 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.
>>>>
>>
>
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
>&
--
>> 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.
>>
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
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
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
>
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"
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
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.
>> {
> >> }}
> >>
> >> //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.
> >>
>
>
> }}
>>
>> //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.
>>
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
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
-development.247.n4.nabble.com/flexjs-foreach-very-slow-tp52571.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
21 matches
Mail list logo