eval vs. jquery selector

JavaScript performance comparison

Revision 95 of this test case created by

Preparation code

<script src = "http://code.jquery.com/jquery-1.11.0.min.js" ></script>
<p id="foo">Foo</p>
<p id="bar_87949845616519816516541651651984894611165156165">Bar</p>
<p id="baz">Baz</p>
    

Preparation code output

<p id="foo">Foo</p> <p id="bar_87949845616519816516541651651984894611165156165">Bar</p> <p id="baz">Baz</p>

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 bar = eval("bar_87949845616519816516541651651984894611165156165").apply();
pending…
jquery
var bar = $("#bar_87949845616519816516541651651984894611165156165").apply();
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

Foo

Bar

Baz