jQuery vs Zepto vs VanillaJS
JavaScript performance comparison
Preparation code
<script src="//code.jquery.com/jquery-1.8.1.min.js">
</script>
<script>
jQuery.noConflict();
</script>
<script src="http://zeptojs.com/zepto.min.js">
</script>
<div id="idSelector">
</div>
<div class="classSelector">
</div>
<ul id="iteration">
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
</ul>
<div id="cssGetter" style="color: black;">
</div>
<div id="cssSetter" style="color: black;">
</div>
<div id="find">
<span>
</span>
<div>
<strong>
</strong>
</div>
</div>
<script>
Benchmark.prototype.setup = function() {
var container = document.createElement('div');
container.id = 'testContainer';
document.body.appendChild(container);
};
Benchmark.prototype.teardown = function() {
var testContainer = document.getElementById('testContainer');
document.body.removeChild(testContainer);
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jQuery Element Creation |
|
pending… |
Zepto Element Creation |
|
pending… |
Vanilla Element Creation |
|
pending… |
jQuery Tag Search |
|
pending… |
Zepto Tag Search |
|
pending… |
Vanilla Tag Search |
|
pending… |
jQuery Children Search |
|
pending… |
Zepto Children Search |
|
pending… |
Vanilla Children Search |
|
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 2: published
- Revision 4: published
0 comments