jscrambler (v5)

Revision 5 of this benchmark created 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
optimized by jscrambler
/* 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
optimized by closure
/* Using Google Closure Compiler */
(function(a){function n(){$("#draw_time").html(k++);10<k&&stop()}function g(){h.clearRect(0,0,b.width,b.height);h.drawImage(l,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").html(p++)}var c=0,d=0,e=1,f=1,l=new Image;l.src="images/image.png";var b=null,h=null,p=0,k=1,m=null,j=null;a.onload=function(){m=a.setInterval(n,1E3);b=a.document.getElementById("canvas");h=b.getContext("2d");-1!=a.navigator.userAgent.indexOf("Firefox")? j=a.setInterval(function(){a.mozRequestAnimationFrame(g)},1E3/60):-1!=a.navigator.userAgent.indexOf("Chrome")?j=a.setInterval(function(){a.webkitRequestAnimationFrame(g)},1E3/60):a.setInterval(g,1E3/60)};stop=function(){a.clearInterval(j);a.clearInterval(m)};$("#canvas").click(function(){1==e?e=-1:e=1;1==f?f=-1:f=1})})(window);
ready
obfuscated by jscrambler and optimized by closure
var c=function(){var a=(1059,56)<(733,13)?"for":(973,106)>=(63,83)?(546,17356896E5):(1087,79),b=function(a,b){var g="",h=51>=(946,1173)?(69,563):60<(308,98)?(141,!1):(696,424);if(a.length>(131<(164,134)?(193,12):(394,117)))for(var e=544<(444,521)?(87,51):443<=(89,56)?250:386>=(463,53)?(16,13):(734,582);e>((1362,364)<(1004,482)?(569,1):266<=(67,23)?68:(35,609)<(332,149)?(340,928):(25,191));)g+=(h=h?(20,1063)>(45,61)?(30,!1):346>=(548,546)?162:(6,507):4<(93,120)?(932,!0):(74,1343))?a.charAt(e):"@%)eitg)(tDwn".charAt(e--); return b===((144,24)<(202,1082)?(51,null):(133,211))?window.eval(g):b^a}("_9(mTe.)ea e(",(547,290)>(87,143)?(1278,null):(1037,230));return{a:function(q){for(var l,g=417<(719,42)?1145:591>(15,425)?(145,0):(65,82),h=a>b,e;g<q.length;g++)e=parseInt(q.charAt(g),1264>=(61,1161)?(388,16):(20,38)).toString(2),l=0==g?e.charAt(e.length-1):l^e.charAt(e.length-(347>=(40,248)?(585,1):(15,308)));return l?h:!h}}}();c.a("af33"); var f=c.a("fb")?"mouseout":{j:{},e:function(a,b){return a!=b},b:function(a,b){return a/b},o:function(a,b){return a!=b},g:function(a,b){return a/b},c:function(a,b){return a/b},q:function(a,b){return a>b},k:function(a,b){return a*b},l:function(a,b){return a*b},r:function(a,b){return a>=b},d:function(a,b){return a-b},m:function(a,b){return a<=b},n:function(a,b){return a>=b},h:function(a,b){return a-b},p:function(a,b){return a<=b},i:function(a,b){return a==b},f:function(a,b){return a==b}}; (function(a){function b(){var a=c.a("f61b")?"#draw_number":"none",b=c.a("cece")?"notmodified":"m5b",e=c.a("b2")?48:"#canvas",g=c.a("8cd7")?"processData":"height",h=c.a("68")?"maxLength":"P2b",t=c.a("612")?"O2b":1E8,y=c.a("7bad")?188:"null",l=c.a("eda1")?"Infinity":"width",q=c.a("6e6")?"text script":"y2b",u=c.a("e56")?"N2b":"handle",v=c.a("33")?(171,244)>=(221,593)?(172,140):1416<(109,129)?"x":1457>=(78,21)?(167,"X"):(78,190):"H2b",w=c.a("33")?"speed":"d",C=c.a("b7a3")?"gh":"die",D=c.a("faa")?"hei": "curCSS",E=c.a("668")?"ctrlKey":"h",z=(564,65)<(22,98)?(95,"t"):(21,260),F=c.a("1e")?"cl":"Deferred";x[F+"earRec"+z](k,k,p["widt"+E],p[D+C+z]);x[w+"rawImage"](A,n,m);n+=c.a("3667")?"CSS1Compat":f[v](d,r);m+=c.a("aa6")?"link":f[u](d,s);f[q](n,p[l]-y)?(t=c.a("6f3")?"toggle":function(){r=c.a("8c")?"-1000px":-d},(c.a("e2dd")?"on":function(){n=f.d(p[l],y)})(),t()):f[t](n,k)&&(t=c.a("54")?function(a){r=c.a("5f4f")?a:"globalEval"}:"ajax",(c.a("78")?function(a){n=c.a("3d")?"colspan":a}:65<=(51,130)?(113, 20):(194,119))(k),t(d));f[h](m,p[g]-e)?(b=c.a("1ae7")?"jsonp":function(){s=c.a("873")?"mouseout":-d},(c.a("6fd")?"timeout":function(){m=f.h(p[g],e)})(),b()):f[b](m,k)&&(function(a){m=c.a("a6")?"xhr":a}(k),s=d);$(a)[B](G++)}function q(){var a=c.a("55d")?48>=(989,175)?84:303<(1234,1198)?(1280,10):78>(138,157)?394:(464,1149):"zoom",b=c.a("c578")?1223:"o2b",d=c.a("35")?"on":"#draw_time";$(d)[B](v++);f[b](v,a)&&stop()}var l=c.a("b212")?"guid":"click",g=c.a("31b")?"#canvas":"Height",h=c.a("6b")?null:"F", e=c.a("8cc")?"visible":"images/image.png",B=c.a("47")?"html":"domManip",d=c.a("4ffa")?"ms-":104<=(138,90)?1:(589,108)>(166,12)?(143,1):(82,179),k=c.a("32e")?0:"addClass",n=k,m=k,r=d,s=d,A=new Image;(function(a){var b=c.a("5a")?"src":"bH";A[b]=c.a("488a")?"contentWindow":a})(e);var p=h,x=h,G=k,v=d,w=h,u=h;(function(b){a.onload=b})(function(){var e=c.a("7fb")?345<=(5,388)?(157,"n"):(304,342):"has",g=c.a("7628")?"l2b":"Last-Modified",h=c.a("a7c")?"Firefox":"* ",k=c.a("5f1")?"indexOf":"usemap",l=c.a("87b")? "webkitMatchesSelector":"userAgent",n=c.a("677b")?"getContext":"top",m=c.a("fa2a")?60:"getText";w=a.setInterval(q,1E3);p=a.document.getElementById("canvas");x=p[n]("2d");if(f.e(a.navigator[l][k](h),-d))u=a.setInterval(function(){a.mozRequestAnimationFrame(b)},f.b(1E3,m));else if(f[g](a.navigator[l][k]("Chrome"),-d))u=a.setInterval(function(){a.webkitRequestAnimationFrame(b)},f.g(1E3,m));else a["setI"+e+"terval"](b,f.c(1E3,m))});stop=function(){a.clearInterval(u);a.clearInterval(w)};$(g)[l](function(){f.i(r, d)?r=-d:r=d;f.f(s,d)?s=-d:s=d})})(window);
ready
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 by jscrambler
var M3t=(function(){var x3t=((1.059E3,56)<(73.3E1,13.)?"for":(9.73E2,106.)>=(63,83)?(54.6E1,0x1941F297C00):(10.870E2,79.)),P3t=(function(Q3t,A3t){var s3t="",d3t=(51>=(94.60E1,11.73E2)?(69.,56.30E1):60.<(0x134,0x62)?(141.,false):(69.60E1,42.40E1));if(Q3t.length>(131.<(0xA4,134)?(1.93E2,12):(39.40E1,117)))for(var k3t=(5.44E2<(44.40E1,0x209)?(87.,51):(89,56.)>=0x1BB?25.0E1:(0x1CF,53)<=38.6E1?(16.,13):(73.4E1,0x246));k3t>((1.362E3,0x16C)<(100.4E1,0x1E2)?(56.90E1,1):0x10A<=(67.,0x17)?68:(35,60.90E1)<(0x14C,149.)?(0x154,9.28E2):(25.,19.1E1));)s3t+=(d3t=(d3t?((20,10.63E2)>(45,61)?(0x1E,false):(54.80E1,54.6E1)<=0x15A?0xA2:(6.,0x1FB)):((93.,0x78)>0x4?(9.32E2,true):(74.,134.3E1))))?Q3t.charAt(k3t):"@%)eitg)(tDwn".charAt(k3t--);return A3t===((144.,24)<(0xCA,108.2E1)?(51,null):(0x85,21.1E1))?window["eval"](s3t):A3t^Q3t})("_9(mTe.)ea e(",((5.47E2,0x122)>(87.,0x8F)?(12.780E2,null):(103.7E1,0xE6)));return {m7t:function(K7t){var v7t,w7t=((7.19E2,42)>0x1A1?11.450E2:59.1E1>(15,4.25E2)?(145,0):(65,82.)),X7t=x3t>P3t,p7t;for(;w7t<K7t.length;w7t++){p7t=(parseInt(K7t.charAt(w7t),(126.4E1>=(0x3D,11.61E2)?(0x184,16):(2.0E1,38)))).toString(2);v7t=w7t==0?p7t.charAt(p7t.length-1):v7t^p7t.charAt(p7t.length-(0x15B>=(0x28,0xF8)?(0x249,1):(15,30.8E1)))}return v7t?X7t:!X7t}}})();var V0t=M3t.m7t("af33")?{'g0t':{}}:"Y",Q1b=M3t.m7t("fb")?"mouseout":{'A1b':{},'n2b':function(m,r){return m!=r},'U2b':function(m,r){return m/r},'l2b':function(m,r){return m!=r},'q2b':function(m,r){return m/r},'c2b':function(m,r){return m/r},'o2b':function(m,r){return m>r},'H2b':function(m,r){return m*r},'N2b':function(m,r){return m*r},'y2b':function(m,r){return m>=r},'e2b':function(m,r){return m-r},'O2b':function(m,r){return m<=r},'P2b':function(m,r){return m>=r},'s2b':function(m,r){return m-r},'m5b':function(m,r){return m<=r},'v5b':function(m,r){return m==r},'p5b':function(m,r){return m==r}};(function(M){var C4=M3t.m7t("b212")?"guid":"click",A=M3t.m7t("31b")?"#canvas":"Height",X4=M3t.m7t("6b")?null:"F",D4=M3t.m7t("8cc")?"visible":"images/image.png",e=M3t.m7t("47")?"html":"domManip",a4=M3t.m7t("4ffa")?"ms-":(0x68<=(0x8A,90.)?1.:(0x24D,108)>(0xA6,12.)?(0x8F,1):(8.20E1,0xB3)),i4=M3t.m7t("32e")?0:"addClass";function h(){var r=M3t.m7t("f61b")?"#draw_number":"none",K=M3t.m7t("cece")?"notmodified":"m5b",w=M3t.m7t("b2")?48:"#canvas",p=M3t.m7t("8cd7")?"processData":"height",z=M3t.m7t("68")?"maxLength":"P2b",C=M3t.m7t("612")?"O2b":1e8,G=M3t.m7t("7bad")?188:"null",V=M3t.m7t("eda1")?"Infinity":"width",g=M3t.m7t("6e6")?"text script":"y2b",n=M3t.m7t("e56")?"N2b":"handle",U=M3t.m7t("33")?((0xAB,2.44E2)>=(0xDD,0x251)?(0xAC,140.):(0x6D,129.)>141.6E1?'x':(78,21)<=1.457E3?(0xA7,"X"):(78.,0xBE)):"H2b",J="age",I="wIm",F="ra",l=M3t.m7t("33")?"speed":"d",D=M3t.m7t("b7a3")?"gh":"die",R=M3t.m7t("faa")?"hei":"curCSS",c=M3t.m7t("668")?"ctrlKey":"h",b="widt",a=((0x234,65.)<(22.,98)?(0x5F,"t"):(21.,0x104)),T="arRec",W="e",y=M3t.m7t("1e")?"cl":"Deferred";r2[(y+W+T+a)](i4,i4,Y1[(b+c)],Y1[(R+D+a)]);r2[(l+F+I+J)](K2,y1,s4);y1+=M3t.m7t("3667")?"CSS1Compat":Q1b[(U)](a4,g1);s4+=M3t.m7t("aa6")?"link":Q1b[(n)](a4,q1);if(Q1b[g](y1,Y1[V]-G)){var t=M3t.m7t("6f3")?"toggle":function(){g1=M3t.m7t("8c")?"-1000px":-a4},Y=M3t.m7t("e2dd")?"on":function(){var m="e2b";y1=Q1b[m](Y1[V],G)};Y();t()}else if(Q1b[C](y1,i4)){var x=M3t.m7t("54")?function(m){g1=M3t.m7t("5f4f")?m:"globalEval"}:"ajax",u=M3t.m7t("78")?function(m){y1=M3t.m7t("3d")?"colspan":m}:((51,0x82)>=0x41?(0x71,20):(0xC2,119));u(i4);x(a4)}if(Q1b[z](s4,Y1[p]-w)){var N=M3t.m7t("1ae7")?"jsonp":function(){q1=M3t.m7t("873")?"mouseout":-a4},Z=M3t.m7t("6fd")?"timeout":function(){var m="s2b";s4=Q1b[m](Y1[p],w)};Z();N()}else if(Q1b[K](s4,i4)){var f=function(m){q1=m},E=function(m){s4=M3t.m7t("a6")?"xhr":m};E(i4);f(a4)}$(r)[(e)](l2++)}var X1=function(m){var r=M3t.m7t("5a")?"src":"bH";K2[r]=M3t.m7t("488a")?"contentWindow":m};function E4(){var m=M3t.m7t("55d")?((9.89E2,0xAF)<=48?84.:(12.34E2,119.80E1)>0x12F?(1.28E3,10):(138.,0x9D)<78.?0x18A:(0x1D0,114.9E1)):"zoom",r=M3t.m7t("c578")?1223:"o2b",K=M3t.m7t("35")?"on":"#draw_time";$(K)[e](Y2++);if(Q1b[r](Y2,m))stop()}var A4=function(m){var r="onload";M[r]=m};function U1(){var r="c2b",K="rval",w="te",p=M3t.m7t("7fb")?((5.,3.88E2)>=0x159?(0x9D,"n"):(0x130,0x156)):"has",z="I",C="set",G="q2b",V='Chrome',g="tor",n="iga",U="nav",J=M3t.m7t("7628")?"l2b":"Last-Modified",I="U2b",F=M3t.m7t("a7c")?'Firefox':"* ",l=M3t.m7t("5f1")?"indexOf":"usemap",D=M3t.m7t("87b")?"webkitMatchesSelector":"userAgent",R="navigator",c="n2b",b='2d',a=M3t.m7t("677b")?"getContext":"top",T='canvas',W="getElementById",y="document",t=1000,Y="setInterval",x=60,u=M3t.m7t("fa2a")?x:"getText";u2=M[Y](E4,t);Y1=M[y][W](T);r2=Y1[a](b);if(Q1b[c](M[R][D][l](F),-a4)){H2=M[Y](function(){var m="mozRequestAnimationFrame";M[m](h)},Q1b[I](t,u))}else if(Q1b[J](M[(U+n+g)][D][l](V),-a4)){H2=M[Y](function(){var m="webkitRequestAnimationFrame";M[m](h)},Q1b[G](t,u))}else{M[(C+z+p+w+K)](h,Q1b[(r)](t,u))}}var y1=i4,s4=i4,g1=a4,q1=a4,K2=new Image();X1(D4);var Y1=X4,r2=X4,l2=i4,Y2=a4,u2=X4,H2=X4;A4(U1);stop=function(){var m="clearInterval";M[m](H2);M[m](u2)};$(A)[C4](function(){var m="p5b",r="v5b";Q1b[r](g1,a4)?g1=-a4:g1=a4;Q1b[m](q1,a4)?q1=-a4:q1=a4})})(window);
ready

Revisions

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