asmjs

JavaScript performance comparison

Revision 11 of this test case created by Calvin Metcalf

Preparation code

<script>
var binaryAnd = (function(stdlib){

function mandlebrot(cx, cy, maxIter) {
        var iter=0;
        var xn= 0.0;
        var x = 0.0;
        var y = 0.0;
        while ( ((x*x + y*y) < 4.0)&(iter < maxIter)) {
            xn = ( x*x - y*y + cx);
            y = ((x*y)*2.0 + cy);
            x = xn;
            iter++;
        }
       
        return iter;
    }
return {    mandlebrot: mandlebrot}
})(window)

var logicalAnd = (function(stdlib){

function mandlebrot(cx, cy, maxIter) {
        var iter=0;
        var xn= 0.0;
        var x = 0.0;
        var y = 0.0;
        while ( ((x*x + y*y) < 4.0)&&(iter < maxIter)) {
            xn = ( x*x - y*y + cx);
            y = ((x*y)*2.0 + cy);
            x = xn;
            iter++;
        }
       
        return iter;
    }
return {    mandlebrot: mandlebrot}
})(window)
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
binary
binaryAnd.mandlebrot(0,0,500)
pending…
logical
logicalAnd.mandlebrot(0,0,500)
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment