I created this test http://jsperf.com/loop-counter why is there such a difference between these three expressions.
the act of performing a ceremony, play, piece of music, etc. the execution or accomplishment of work, acts, feats, etc. a particular action, deed, or proceeding. an action or proceeding of an unusual or spectacular kind: His temper tantrum was quite a performance. the act of performing.
Someone's or something's performance is how successful they are or how well they do something.
The employee exceeds established expectations as measured by results, consistent work quality, quantity and timeliness in most areas of responsibility. He or she exhibits mastery in most dimensions of the work performed, making a significant contribution in support of the department, division or university goals.
(countable) A performance is a show of acting or music. We went to see a performance by local musicians last night. The acting was good, but the noise made it difficult to enjoy the performance.
because your test is wrong. you're reusing the same variable, so the larger it gets, the slower it is to increment. take a look at this: http://jsperf.com/loop-counter/6
this is how jsperf works - preparation code is run only once, before all tests.
I tried running all three tests several times, and each time I reload the page, the first test I try is the fastest by far.
So I'm guessing there is some issue with the test being too short, i.e. the code that runs the tests is taking up most of the time.
If this is not a rhetorical question and you actually want an aswer then: becuse of how people have written the JS engine in the browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With