Test fct generation

Benchmark created on


Setup

let f1 = new Function('a', 'return a+a');
let f2 = eval('function x(a){ return a+a }; x');
let f3 = function(a){ return a+a };

let sum = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
1
for(let i = 0; i < 10000; ++i)
    sum += f1(i);
ready
2
for(let i = 0; i < 10000; ++i)
    sum += f2(i);
ready
3
for(let i = 0; i < 10000; ++i)
    sum += f3(i);
ready

Revisions

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