Eval vs new Function

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Eval
eval('(function(test) { return test.a; })')({a: true})
 
ready
new Function
new Function('test', 'return test.a;')({a: true})
ready
eval (no args)
eval('(function() { return true; })')()
 
ready
new Function (no args)
new Function('return true;')()
ready

Revisions

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