eval vs script

JavaScript performance comparison

Test case created by ThinkingStiff

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
eval
eval( 'for (var i = 0 ; i<10000;i++){var x = 100; var y = 200;}' );
 
pending…
script
var myScript = document.createElement('script');
myScript.setAttribute('type', 'text/javascript');
myScript.innerHTML = 'for (var i = 0 ; i<10000;i++){var x = 100; var y = 200;}';
document.body.appendChild(myScript);
pending…

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

Compare results of other browsers

0 comments

Add a comment