getElementById vs everyone else
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
<script>
var YOne;
YUI().use( 'node', function(Y) {
window.YOne = Y.one;
});
</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>
<div id="identified">I'm a div. Find me!</div>
Preparation code output
I'm a div. Find me!
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
getElementById |
|
pending… |
querySelectorAll |
|
pending… |
jQuery |
|
pending… |
YUI |
|
pending… |
Dojo |
|
pending… |
null |
|
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:
- Revision 1: published by Rick Waldron
- Revision 2: published by Kyle A. Matheny
0 comments