|
|
JavaScript Speed Test
|
04/23/2006, By Ajax Impact News
|
Jason Orendorff has written an JavaScript speed test that you can run from your browsers.
No one should care about JavaScript performance. But if you do, this page will help you get a feel for which operations are fast and which are slow. For example, you might be surprised to find that accessing array elements is no faster than accessing object properties.
How to play. Double-click any box in the “Results” column to run the test. Or click the “Start tests” button to run them all; but that takes a while. Each test takes 2 or 3 seconds to run.
Accuracy. The results are very noisy. Double-click any cell two or three times and you'll get different results. I imagine you can get maybe one significant digit out of these, maybe a bit less. All results include the overhead of a simple for loop; run the “Empty loop” test to see how much this is. All tests are run three times; the best time is shown.
How it works. For each test, the tester uses new Function() to create a function that takes a positive whole number N and times the execution of the test code N times in a tight loop. Then it calls the function repeatedly, with N=1, then 2, then 5, 10, 20, 50, and so on until the loop actually takes a significant amount of time to execute (at least 100ms). It does this 5 times, throws out the worst time, and averages the other four. This average is what's displayed.
Explore JavaScript Speed Test now..
|
Rate this Ajax News
Rating: 7.0 out of 4 votes cast
| |
|
|
| |
|
|
|
|
|
|
|
|