jscrambler (v7)

Revision 7 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
closure
(function(a){function p(){$("#draw_time").a(l++);10<l&&stop()}function g(){h.clearRect(0,0,b.width,b.height);h.drawImage(m,c,d);c+=1*e;d+=1*f;c>=b.width-188?(c=b.width-188,e=-1):0>=c&&(c=0,e=1);d>=b.height-48?(d=b.height-48,f=-1):0>=d&&(d=0,f=1);$("#draw_number").a(q++)}var c=0,d=0,e=1,f=1,m=new Image;m.src="images/image.png";var b=null,h=null,q=0,l=1,n=null,k=null;a.onload=function(){n=a.setInterval(p,1E3);b=a.document.getElementById("canvas");h=b.getContext("2d");-1!=a.navigator.userAgent.indexOf("Firefox")? k=a.setInterval(function(){a.mozRequestAnimationFrame(g)},1E3/60):-1!=a.navigator.userAgent.indexOf("Chrome")?k=a.setInterval(function(){a.webkitRequestAnimationFrame(g)},1E3/60):a.setInterval(g,1E3/60)};stop=function(){a.clearInterval(k);a.clearInterval(n)};$("#canvas").click(function(){1==e?e=-1:e=1;1==f?f=-1:f=1})})(window);
ready
jsobfuscate
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5(2){3 x=0;3 y=0;3 6=1;3 8=1;3 9=F E();9.G="H/9.I";3 4=f;3 b=f;3 u=0;3 j=1;3 l=f;3 h=f;2.D=o;5 o(){3 e=C;l=2.d(p,c);4=2.A.z(\'4\');b=4.J(\'L\');7(2.s.r.q(\'R\')!=-1){h=2.d(5(){2.T(g)},c/e)}a 7(2.s.r.q(\'S\')!=-1){h=2.d(5(){2.K(g)},c/e)}a{2.d(g,c/e)}}5 p(){$("#P").w(j++);7(j>Q)m()}5 g(){b.M(0,0,4.i,4.k);b.N(9,x,y);x+=1*6;y+=1*8;7(x>=4.i-v){x=4.i-v;6=-1}a 7(x<=0){x=0;6=1}7(y>=4.k-t){y=4.k-t;8=-1}a 7(y<=0){y=0;8=1}$("#O").w(u++)}m=5(){2.n(h);2.n(l)};$("#4").B(5(){6==1?6=-1:6=1;8==1?8=-1:8=1})})(2);',56,56,'||window|var|canvas|function|xDirection|if|yDirection|image|else|context2D|1000|setInterval|FPS|null|draw|run_animation|width|time|height|run_timer|stop|clearInterval|init|timer|indexOf|userAgent|navigator|48|count|188|html|||getElementById|document|click|60|onload|Image|new|src|images|png|getContext|webkitRequestAnimationFrame|2d|clearRect|drawImage|draw_number|draw_time|10|Firefox|Chrome|mozRequestAnimationFrame'.split('|'),0,{}))
ready

Revisions

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