arraysize fnagel

JavaScript performance comparison

Test case created

Preparation code

        <script type="text/javascript">

                var array = [],
                        x = 800,
                        y = 600;

                count = x * y;
                while(x){
                        array[x] = [];
                        var y2 = y;
                        while(y2){
                                array[x][y2] = Math.round(Math.random());
                                y2--;
                        }
                        x--;
                }
console.log('ok');







        </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
var test = array[xrand][yrand];
pending…
s2
var test = array[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