jquery eval vs windows.execscript eval

JavaScript performance comparison

Test case created by sameer

Info

Performance measurement between jquery eval and windows execute script eval.

Preparation code

<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</head>
<body>
</body>

</html>
<script>
  var javscriptStr = "var a=3,b=789378437;c=(a+b)/34566;"
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
window exec script
if (window.execScript) {
    window.execScript(javscriptStr); // eval in global scope for IE
    return null; // execScript doesnt return anything
  }
pending…
jquery eval
jQuery.globalEval(javscriptStr);
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. Here’s a list of current revisions for this page:

0 comments

Add a comment