Eval vs new Function (v11)

Revision 11 of this benchmark created by S-YOU on


Test runner

Ready to run.

Testing in
TestOps/sec
Eval
var func=eval('(function(a,b) { return a.value; })');
//func({value:true})
 
ready
new Function
var func=new Function('a', 'b', 'return a.value;');
//func({value:true})
ready
eval []
var func=eval('[(function(a,b) { return a.value; })][0]');
//func({value:true})
ready

Revisions

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