eval() vs new Function()

JavaScript performance comparison

Revision 19 of this test case created by

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
eval
var NameObj = function(your){var name=yourname};

eval("var m = [new NameObj ('1'),new NameObj ('2'),new NameObj ('3'),new NameObj ('4'),new NameObj ('5'),new NameObj ('6'),new NameObj ('7'),new NameObj ('8'),new NameObj ('9'),new NameObj ('10'),new NameObj ('11'),new NameObj ('12'),new NameObj ('13'),new NameObj ('14')];");
pending…
native
var NameObj = function(your){var name=yourname};

var m = [new NameObj ('1'),new NameObj ('2'),new NameObj ('3'),new NameObj ('4'),new NameObj ('5'),new NameObj ('6'),new NameObj ('7'),new NameObj ('8'),new NameObj ('9'),new NameObj ('10'),new NameObj ('11'),new NameObj ('12'),new NameObj ('13'),new NameObj ('14')];
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.

0 Comments