Thanks for that info and link, Robert! Obviously, we who develop web
apps for normal users should leave the setting alone most of the time,
but good to know we can change it for these sorts of tests. (And wow,
I thought it was a time limit; that explains why something I was doing
the other day was giving me this error way faster than I expected.)

Results for IE7 on Windows XP:

http://tinyurl.com/y8fb77y
http://tinyurl.com/yd3vuzz
http://tinyurl.com/ydqgvwr
http://tinyurl.com/ye8hwvb

(I find it's best to run these tests multiple times.) Basically, it's
a wash (++i or i++), but i += 1 is markedly slower. As you say,
Robert, unlikely to make any difference in the real world.

I'd post Chrome and Firefox results for Windows, but I kept getting
infinite numbers of operations per second! ;-) Chrome (of course!) did
an infinite number of ops/second on all of the tests. Firefox
alternated between infinite numbers of ++i and i++ operations -- so
probably a wash there too.

Now, since I apparently have the power to do infinite numbers of
calculations, I'm off to break some RSA keys...

-- T.J. ;-)

On Dec 16, 2:48 pm, Robert Kieffer <bro...@gmail.com> wrote:
> Unfortunately IE limits scripts to "5M statements", rather than limiting by
> time.  That limit was set back in the days of IE4, when 5M statements would
> take ~10 seconds to run.  But newer hardware/script engines hit that in a
> fraction of a second now... which is why you're seeing it.
>
> The workaround is to edit your registry to increase the limit to 50M
> statements (or more). This MS article explains how, and provides a bit more
> background on  of this ( ridiculous) behavior.
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;175500
>
>
>
> On Wed, Dec 16, 2009 at 4:44 AM, Allen Madsen <bla...@gmail.com> wrote:
> > I tried running your test on IE8 and it just kept prompting me with script
> > unresponsive.
>
> > Allen Madsen
> >http://www.allenmadsen.com
>
> > On Wed, Dec 16, 2009 at 7:01 AM, Robert Kieffer <bro...@gmail.com> wrote:
>
> >> I whipped up a quick JSLitmus test to try out a handful of empty loops
> >> (using i++, ++i, i+=1, and a while loop:
> >>http://www.broofa.com/Tools/JSLitmus/tests/loop_operators.html
>
> >> View the [very short] source of the page to see the actual test code.
> >> When running the test for yourself, be sure to uncheck the "normalize" box.
> >> Also, you'll probably want to run each test a few times to make sure you're
> >> getting consistent results (CPU load elsewhere in the OS can skew resutls).
> >> For more on JSLitmus, readhttp://www.broofa.com/Tools/JSLitmus)
>
> >> Here are the results I got on my MacBook (sorry, don't have IE results
> >> handy)
> >> FF:http://tinyurl.com/ykdutyk
> >> Safari:http://tinyurl.com/yzusg7e
> >> Opera:http://tinyurl.com/yjamzwc
> >> Chrome:http://tinyurl.com/ylylyw5
>
> >> Executive summary: On the above browsers, performance does vary. i++ or
> >> ++i are the best all-round performers, while the while() loop is generally
> >> not as good.  However on all of these systems ('cept Opera), looping code
> >> runs so fast that performance is negligable compared to whatever code you
> >> put inside the loop.  I.e. it's unlikely to matter in all but the most
> >> trivial of loops.
>
> >> - rwk
>
> >> On Wed, Dec 16, 2009 at 2:28 AM, Yaffle <vic99...@yandex.ru> wrote:
>
> >>> ++i; is a little more efficient in C language,
> >>> in javascript difference in performance of all these operators is tiny
>
> >>> On Dec 16, 3:21 pm, RQuadling <rquadl...@googlemail.com> wrote:
> >>> > Hi.
>
> >>> > Is there any consensus on which is more efficient in a for() loop?
>
> >>> > I was taught that for ++i being the most efficient.
>
> >>> > I've created 2 patches (++ and a +1) in case anyone is interested.
>
> >>> >http://pastie.org/private/3rgonpsn90yjd17q9zwa
> >>> > andhttp://pastie.org/private/qufy3rwmaevxc1sysvq
>
> >>> > From what I've read, this could be a little pointless, but I'm not the
> >>> > expert in this area.
>
> >>> > Regards,
>
> >>> > Richard.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Prototype: Core" group.
> >>> To post to this group, send email to prototype-core@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> prototype-core-unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/prototype-core?hl=en
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "Prototype: Core" group.
> >> To post to this group, send email to prototype-core@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> prototype-core-unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/prototype-core?hl=en
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Prototype: Core" group.
> > To post to this group, send email to prototype-core@googlegroups.com
> > To unsubscribe from this group, send email to
> > prototype-core-unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/prototype-core?hl=en

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Reply via email to