@BrendanEich In JS array.length is a property.
Why is for(i=0;i<array,length;i++){} slower than
for(i=0,len=array,length;i<len;i++){} ?
-
-
Replying to @phidip
@phidip slower in what engine(s)? Did you put up a http://jsperf.com page? In unoptimized engines, var (local I hope!) beats property.1 reply 0 retweets 0 likes -
Replying to @BrendanEich
@BrendanEich this was in a very recent FF Aurora. 5 ms in a million iterations ;) will do more experiments. Basic research ;)4 replies 0 retweets 0 likes -
Replying to @phidip
@phidip@BrendanEich Can you link to the full testcase you're using?3 replies 0 retweets 0 likes -
Replying to @really_bz
@bz_moz@BrendanEich my testpage is at http://deformation.org/mdu/sem2/code/longloops.html …. I am running on FF Aurora 26.02 replies 0 retweets 0 likes
Replying to @phidip
@phidip @BrendanEich Thanks. 2ms per loop means 2ns per iteration. That's just the read/write of the loop variable.
6:37 AM - 21 Jan 2014
0 replies
1 retweet
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.