jscrambler (v8)

Revision 8 of this benchmark created by xbaum on


Preparation HTML

<div id="container">
            <img src="images/logo.png" />
            <h1>SIMPLE DEMO</h1>
            <canvas id="canvas" width="640" height="480" oncontextmenu="return false;" onselectstart="return false;">
                <!-- This text is displayed if the visitor's browser does not support HTML5.
                You can change it, but it is a good idea to link to a description of a browser
                and provide some links to download some popular HTML5-compatible browsers. -->
                Your browser does not appear to support HTML5.  Try upgrading your browser to the latest version.  <a href="http://www.whatbrowser.org/">What is a browser?</a>
                <br><br><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br>
                <a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br>
                <a href="http://www.google.com/chrome/">Google Chrome</a><br>
                <a href="http://www.apple.com/safari/download/">Apple Safari</a><br>
                <a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a><br>
            </canvas>
            <div style="margin-top:30px;"><button onclick="stop()">Stop</button> Drew <span id="draw_number"></span> images in <span id="draw_time">0</span> seconds (60FPS).</div>
            <p>(Test duration: 10 seconds)</p>
            <br>
        </div>		
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
normal
(function(window) {
    var x = 0;
    var y = 0;
    var xDirection = 1;
    var yDirection = 1;
    var image = new Image();
    image.src = "images/image.png";
    var canvas = null;
    var context2D = null;
    var count = 0;
    var time = 1;
    var run_timer = null;
    var run_animation = null;
    
    window.onload = init;
    
    function init() {	
        var FPS = 60;
        run_timer = window.setInterval(timer,1000);
        canvas = window.document.getElementById('canvas');
        context2D = canvas.getContext('2d');
        if(window.navigator.userAgent.indexOf('Firefox') != -1) {
            run_animation = window.setInterval(function() {
                window.mozRequestAnimationFrame(draw);
            }, 1000/FPS);
        }
        else if(window.navigator.userAgent.indexOf('Chrome') != -1) {
            run_animation = window.setInterval(function() {
                window.webkitRequestAnimationFrame(draw);
            }, 1000/FPS);
        }
        else {
            window.setInterval(draw, 1000/FPS);
        };
    }

    function timer() {	
        $("#draw_time").html(time++);
        if(time > 10) stop(); 
    }

    function draw() {	
        context2D.clearRect(0, 0, canvas.width, canvas.height);
        context2D.drawImage(image, x, y);
        x += 1 * xDirection;
        y += 1 * yDirection;

        if (x >= canvas.width-188){
            x = canvas.width-188;
            xDirection = -1;
        }
        else if (x <= 0){
            x = 0;
            xDirection = 1;
        }	
        if (y >= canvas.height-48){
            y = canvas.height-48;
            yDirection = -1;
        }
        else if (y <= 0){
            y = 0;
            yDirection = 1;
        }

        $("#draw_number").html(count++);
    }

    stop = function () {
        window.clearInterval(run_animation);
        window.clearInterval(run_timer);
    };

    $("#canvas").click(function() {
        xDirection ==1? xDirection = -1 : xDirection =1;
        yDirection ==1? yDirection = -1 : yDirection =1;	
    });
})(window);
ready
obfuscated
/* Obfuscate your JavaScript at https://jscrambler.com */var f8f={'O0':function(f,Y){return f==Y;},'u':function(f,Y){return f-Y;},'C':function(f,Y){return f/Y;},'g':function(f,Y){return f/Y;},'b':function(f,Y){return f*Y;},'v':function(f,Y){return f>=Y;},'a0':function(f,Y){return f==Y;},'j':function(f,Y){return f<=Y;},'F':function(f,Y){return f>Y;},'U':function(f,Y){return f>=Y;},'G8':(function(){var o8=0,K8='',l8=[NaN,null,NaN,null,[],'',{},false,/ /,false,'','',[],false,{},-1,/ /,NaN,-1,-1,{},{},/ /,-1,NaN,NaN,[],'',NaN,-1,/ /,null,null,[],[],[],{},[],null,null,[]],w8=l8["length"];for(;o8<w8;){K8+=+(typeof l8[o8++]!=='object');}var y8=parseInt(K8,2),n8='http://localhost?q=;%29%28emiTteg.%29%28etaD%20wen%20nruter',E8=n8.constructor.constructor(unescape(/;.+/["exec"](n8))["split"]('')["reverse"]()["join"](''))();return {a8:function(c8){var Z8,o8=0,M8=y8-E8>w8,g8;for(;o8<c8["length"];o8++){g8=parseInt(c8["charAt"](o8),16)["toString"](2);var q8=g8["charAt"](g8["length"]-1);Z8=o8===0?q8:Z8^q8;}return Z8?M8:!M8;}};})(),'N':function(f,Y){return f*Y;},'V':function(f,Y){return f/Y;},'f0':function(f,Y){return f<=Y;},'W':function(f,Y){return f-Y;}};(function(O){var S=f8f.G8.a8("d3")?"xDirection":"click",I=f8f.G8.a8("e37c")?'Firefox':"#canvas",r=f8f.G8.a8("f877")?null:"userAgent",T=f8f.G8.a8("7c2")?"images/image.png":'Firefox',i=f8f.G8.a8("ad4")?"html":"timer",t=f8f.G8.a8("28")?"#canvas":0,p=f8f.G8.a8("14")?1:0,p0=f8f.G8.a8("88b")?function(f){var Y="onload";O[Y]=f;}:"#canvas";function Y0(){var Y="C",y="V",M=f8f.G8.a8("1e")?'Chrome':'2d',R=f8f.G8.a8("5374")?"g":"xDirection",e=f8f.G8.a8("5a24")?'Firefox':60,n="indexOf",q=f8f.G8.a8("cfc")?"userAgent":"stop",P=f8f.G8.a8("58")?"navigator":"onload",h='2d',m="getContext",E=f8f.G8.a8("d7")?1000:'canvas',c="getElementById",s="document",a=f8f.G8.a8("6bd1")?1000:188,B="setInterval",H=f8f.G8.a8("13a")?null:60,Z=H;L=O[B](G0,a);G=O[s][c](E);D=G[m](h);if(O[P][q][n](e)!=-p){Q=O[B](function(){var f="mozRequestAnimationFrame";O[f](d);},f8f[R](a,Z));}else if(O[P][q][n](M)!=-p){Q=O[B](function(){var f="webkitRequestAnimationFrame";O[f](d);},f8f[y](a,Z));}else{O[B](d,f8f[Y](a,Z));};}function d(){var Y="#draw_number",y="f0",M=48,R="U",e="j",n=188,q="v",P="b",h="N",m="drawImage",E="height",c="width",s="clearRect";D[s](t,t,G[c],G[E]);D[m](A,K,l);K+=f8f[h](p,o);l+=f8f[P](p,w);if(f8f[q](K,G[c]-n)){var a=function(){o=-p;},B=function(){var f="W";K=f8f[f](G[c],n);};B();a();}else if(f8f[e](K,t)){var H=function(f){o=f;},Z=function(f){K=f;};Z(t);H(p);}if(f8f[R](l,G[E]-M)){var x=function(){var f="u";l=f8f[f](G[E],M);},X=function(){w=-p;};x();X();}else if(f8f[y](l,t)){var z=function(f){l=f;},k=function(f){w=f;};z(t);k(p);}$(Y)[i](B0++);}function G0(){var f=10,Y="F",y="#draw_time";$(y)[i](J++);if(f8f[Y](J,f))stop();}var t0=function(f){var Y="src";A[Y]=f;},K=t,l=t,o=p,w=p,A=new Image();t0(T);var G=r,D=r,B0=t,J=p,L=r,Q=r;p0(Y0);stop=function(){var f="clearInterval";O[f](Q);O[f](L);};$(I)[S](function(){var f="a0",Y="O0";f8f[Y](o,p)?o=-p:o=p;f8f[f](w,p)?w=-p:w=p;});})(window);
ready
optimized
/* Obfuscate your JavaScript at https://jscrambler.com */(function(b){var c=0,d=0,f=1,g=1,h=new Image();h.src="images/image.png";var i=null,j=null,k=0,m=1,p=null,l=null;b.onload=v;function v(){var a=60;p=b.setInterval(o,1000);i=b.document.getElementById('canvas');j=i.getContext('2d');if(b.navigator.userAgent.indexOf('Firefox')!=-1){l=b.setInterval(function(){b.mozRequestAnimationFrame(u)},1000/a)}else if(b.navigator.userAgent.indexOf('Chrome')!=-1){l=b.setInterval(function(){b.webkitRequestAnimationFrame(u)},1000/a)}else{b.setInterval(u,1000/a)}}function o(){$("#draw_time").html(m++);if(m>10)stop()}function u(){j.clearRect(0,0,i.width,i.height);j.drawImage(h,c,d);c+=1*f;d+=1*g;if(c>=i.width-188){c=i.width-188;f=-1}else if(c<=0){c=0;f=1}if(d>=i.height-48){d=i.height-48;g=-1}else if(d<=0){d=0;g=1}$("#draw_number").html(k++)}stop=function(){b.clearInterval(l);b.clearInterval(p)};$("#canvas").click(function(){f==1?f=-1:f=1;g==1?g=-1:g=1})})(window);
ready
http://javascriptobfuscator.com/
var _0x3533=["\x73\x72\x63","\x69\x6D\x61\x67\x65\x73\x2F\x69\x6D\x61\x67\x65\x2E\x70\x6E\x67","\x6F\x6E\x6C\x6F\x61\x64","\x73\x65\x74\x49\x6E\x74\x65\x72\x76\x61\x6C","\x63\x61\x6E\x76\x61\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x64\x6F\x63\x75\x6D\x65\x6E\x74","\x32\x64","\x67\x65\x74\x43\x6F\x6E\x74\x65\x78\x74","\x46\x69\x72\x65\x66\x6F\x78","\x69\x6E\x64\x65\x78\x4F\x66","\x75\x73\x65\x72\x41\x67\x65\x6E\x74","\x6E\x61\x76\x69\x67\x61\x74\x6F\x72","\x6D\x6F\x7A\x52\x65\x71\x75\x65\x73\x74\x41\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x46\x72\x61\x6D\x65","\x43\x68\x72\x6F\x6D\x65","\x77\x65\x62\x6B\x69\x74\x52\x65\x71\x75\x65\x73\x74\x41\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x46\x72\x61\x6D\x65","\x68\x74\x6D\x6C","\x23\x64\x72\x61\x77\x5F\x74\x69\x6D\x65","\x77\x69\x64\x74\x68","\x68\x65\x69\x67\x68\x74","\x63\x6C\x65\x61\x72\x52\x65\x63\x74","\x64\x72\x61\x77\x49\x6D\x61\x67\x65","\x23\x64\x72\x61\x77\x5F\x6E\x75\x6D\x62\x65\x72","\x63\x6C\x65\x61\x72\x49\x6E\x74\x65\x72\x76\x61\x6C","\x63\x6C\x69\x63\x6B","\x23\x63\x61\x6E\x76\x61\x73"];(function (_0x872bx1){var _0x872bx2=0;var _0x872bx3=0;var _0x872bx4=1;var _0x872bx5=1;var _0x872bx6= new Image();_0x872bx6[_0x3533[0]]=_0x3533[1];var _0x872bx7=null;var _0x872bx8=null;var _0x872bx9=0;var _0x872bxa=1;var _0x872bxb=null;var _0x872bxc=null;_0x872bx1[_0x3533[2]]=_0x872bxd;function _0x872bxd(){var _0x872bxe=60;_0x872bxb=_0x872bx1[_0x3533[3]](_0x872bxf,1000);_0x872bx7=_0x872bx1[_0x3533[6]][_0x3533[5]](_0x3533[4]);_0x872bx8=_0x872bx7[_0x3533[8]](_0x3533[7]);if(_0x872bx1[_0x3533[12]][_0x3533[11]][_0x3533[10]](_0x3533[9])!=-1){_0x872bxc=_0x872bx1[_0x3533[3]](function (){_0x872bx1[_0x3533[13]](_0x872bx10);} ,1000/_0x872bxe);} else {if(_0x872bx1[_0x3533[12]][_0x3533[11]][_0x3533[10]](_0x3533[14])!=-1){_0x872bxc=_0x872bx1[_0x3533[3]](function (){_0x872bx1[_0x3533[15]](_0x872bx10);} ,1000/_0x872bxe);} else {_0x872bx1[_0x3533[3]](_0x872bx10,1000/_0x872bxe);} ;} ;} ;function _0x872bxf(){$(_0x3533[17])[_0x3533[16]](_0x872bxa++);if(_0x872bxa>10){stop();} ;} ;function _0x872bx10(){_0x872bx8[_0x3533[20]](0,0,_0x872bx7[_0x3533[18]],_0x872bx7[_0x3533[19]]);_0x872bx8[_0x3533[21]](_0x872bx6,_0x872bx2,_0x872bx3);_0x872bx2+=1*_0x872bx4;_0x872bx3+=1*_0x872bx5;if(_0x872bx2>=_0x872bx7[_0x3533[18]]-188){_0x872bx2=_0x872bx7[_0x3533[18]]-188;_0x872bx4=-1;} else {if(_0x872bx2<=0){_0x872bx2=0;_0x872bx4=1;} ;} ;if(_0x872bx3>=_0x872bx7[_0x3533[19]]-48){_0x872bx3=_0x872bx7[_0x3533[19]]-48;_0x872bx5=-1;} else {if(_0x872bx3<=0){_0x872bx3=0;_0x872bx5=1;} ;} ;$(_0x3533[22])[_0x3533[16]](_0x872bx9++);} ;stop=function (){_0x872bx1[_0x3533[23]](_0x872bxc);_0x872bx1[_0x3533[23]](_0x872bxb);} ;$(_0x3533[25])[_0x3533[24]](function (){_0x872bx4==1?_0x872bx4=-1:_0x872bx4=1;_0x872bx5==1?_0x872bx5=-1:_0x872bx5=1;} );} )(window);
ready
gulp-ugly
(function(ಠ_ಠ655) {
    var ಠ_ಠ637 = 0;
    var ಠ_ಠ638 = 0;
    var ಠ_ಠ639 = 1;
    var ಠ_ಠ640 = 1;
    var ಠ_ಠ641 = new ಠ_ಠ642();
    ಠ_ಠ641.ಠ_ಠ653 = "images/ಠ_ಠ641.png";
    var ಠ_ಠ643 = null;
    var ಠ_ಠ644 = null;
    var ಠ_ಠ645 = 0;
    var ಠ_ಠ646 = 1;
    var ಠ_ಠ647 = null;
    var ಠ_ಠ648 = null;
    
    ಠ_ಠ655.ಠ_ಠ654 = ಠ_ಠ650;
    
    function ಠ_ಠ650() {   
        var ಠ_ಠ649 = 60;
        ಠ_ಠ647 = ಠ_ಠ655.setInterval(ಠ_ಠ651,1000);
        ಠ_ಠ643 = ಠ_ಠ655.document.getElementById('ಠ_ಠ643');
        ಠ_ಠ644 = ಠ_ಠ643.getContext('2d');
        if(ಠ_ಠ655.navigator.userAgent.indexOf('Firefox') != -1) {
            ಠ_ಠ648 = ಠ_ಠ655.setInterval(function() {
                ಠ_ಠ655.mozRequestAnimationFrame(ಠ_ಠ652);
            }, 1000/ಠ_ಠ649);
        }
        else if(ಠ_ಠ655.navigator.userAgent.indexOf('Chrome') != -1) {
            ಠ_ಠ648 = ಠ_ಠ655.setInterval(function() {
                ಠ_ಠ655.webkitRequestAnimationFrame(ಠ_ಠ652);
            }, 1000/ಠ_ಠ649);
        }
        else {
            ಠ_ಠ655.setInterval(ಠ_ಠ652, 1000/ಠ_ಠ649);
        };
    }

    function ಠ_ಠ651() {  
        $("#draw_time").html(ಠ_ಠ646++);
        if(ಠ_ಠ646 > 10) stop(); 
    }

    function ಠ_ಠ652() {   
        ಠ_ಠ644.clearRect(0, 0, ಠ_ಠ643.width, ಠ_ಠ643.height);
        ಠ_ಠ644.drawImage(ಠ_ಠ641, ಠ_ಠ637, ಠ_ಠ638);
        ಠ_ಠ637 += 1 * ಠ_ಠ639;
        ಠ_ಠ638 += 1 * ಠ_ಠ640;

        if (ಠ_ಠ637 >= ಠ_ಠ643.width-188){
            ಠ_ಠ637 = ಠ_ಠ643.width-188;
            ಠ_ಠ639 = -1;
        }
        else if (ಠ_ಠ637 <= 0){
            ಠ_ಠ637 = 0;
            ಠ_ಠ639 = 1;
        }       
        if (ಠ_ಠ638 >= ಠ_ಠ643.height-48){
            ಠ_ಠ638 = ಠ_ಠ643.height-48;
            ಠ_ಠ640 = -1;
        }
        else if (ಠ_ಠ638 <= 0){
            ಠ_ಠ638 = 0;
            ಠ_ಠ640 = 1;
        }

        $("#draw_number").html(ಠ_ಠ645++);
    }

    stop = function () {
        ಠ_ಠ655.clearInterval(ಠ_ಠ648);
        ಠ_ಠ655.clearInterval(ಠ_ಠ647);
    };

    $("#ಠ_ಠ643").click(function() {
        ಠ_ಠ639 ==1? ಠ_ಠ639 = -1 : ಠ_ಠ639 =1;
        ಠ_ಠ640 ==1? ಠ_ಠ640 = -1 : ಠ_ಠ640 =1;        
    });
})(ಠ_ಠ655);
ready

Revisions

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