id dec id

JavaScript performance comparison

Test case created by Johnson Jiang

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="head></div>
<div id=" wrapper ">
<div id="main ">
<div id="title ">
</div>
</div>
<div id="content "></div>
<div id="menu "></div>
</div>
<div id="bottom "></div>

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
id
var $title = $("#title");
pending…
id>id
var $title = $("#main #title");
pending…
id>id>id
var $title = $("#wrapper #main #title");
pending…
tag>id
var $title = $("div#title");
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