arraysize fnagel

JavaScript performance comparison

Test case created

Preparation code

        <script type="text/javascript">

                var arr = [],
                        x = 800,
                        y = 600,
                        xCount = x,
                        yCount = y;

                while(xCount){
                        arr[xCount] = [];
                        yCount = y;
                        while(yCount){
                                arr[xCount][yCount] = 1;
                                yCount--;
                        }
                        xCount--;
                }

        </script>
<script>
Benchmark.prototype.setup = function() {
    var xrand = Math.round(Math.random() * (x - 1) + 1);
    var yrand = Math.round(Math.random() * (y - 1) + 1);
};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
s1
//gg
pending…
s2
var test = arr[xrand][yrand];
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment