eval vs. jquery selector

JavaScript performance comparison

Revision 95 of this test case created

Info

Compare the speed of jquery selector to eval

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

Foo

Bar

Baz

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
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. Here’s a list of current revisions for this page:

0 comments

Add a comment