jscrambler

JavaScript performance comparison

Revision 3 of this test case created

Info

test of jscrambler (rev 3)

Preparation code

        <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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
 

Preparation code output

SIMPLE DEMO

Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. What is a browser?

Microsoft Internet Explorer
Mozilla Firefox
Google Chrome
Apple Safari
Google Chrome Frame for Internet Explorer
Drew images in 0 seconds (60FPS).

(Test duration: 10 seconds)


Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/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);
pending…
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);
pending…
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);
 
pending…
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);
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