WWnUjeTozg

JavaScript performance comparison

Test case created by

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div 
id="1" 
data-f= '{"a0": "return \"hello\";" , "a1" : "return \"hi yo\";" }'
></div>
      
<script>
Benchmark.prototype.setup = function() {
  var p =  $('#1').data("f");
  var fun = Function(p.a0);
  var fun2 = Function(p.a1);
  

};
</script>

Preparation code output

<div id="1" data-f= '{"a0": "return \"hello\";" , "a1" : "return \"hi yo\";" }' ></div>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
function1
console.log(fun());
pending…
function2
console.log(fun2());
pending…

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

0 Comments