Zepto vs. jQ vs. jQmobi vs. raw (v109)

Revision 109 of this benchmark created on


Preparation HTML

<script src="http://f.cl.ly/items/0t3w1Z2R2L2s0J2D2Q2q/zepto.min.js">
</script>
<script src="http://f.cl.ly/items/2e2P0m3d1Q2U3w01230Y/jq.mobi.min.js">
</script>
<script src="http://code.jquery.com/jquery-2.0.0b1.js">
</script>
<script src="http://xuijs.com/downloads/xui-2.3.2.min.js">
</script>
<script src="http://jsrun.it/damele0n/tuMO/js">
</script>
<script src="http://jsrun.it/damele0n/tQkX/js"></script>

<div id="asdf">
</div>

Setup

function el(string) {
    if (string.indexOf('#') === 0) {
      return document.getElementById(string.substr(1, string.length));
    }
  }
  
  //to be fair, I'll wrap getElementById in a function and return the object
  
  function byId(id) {
    return document.getElementById(id);
  }
  
  var obj= new Object();
  obj.$s = function(s) {
      return document.getElementById(s);
  }
  
  var boolean = true;

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery 2
jQuery('#asdf')
ready
Direct by reference
obj.$s("asdf");
ready
jQMobi
jq('#asdf')
ready
Raw/baseline
byId('asdf')
ready
Wrapped Raw
el('#asdf')
ready
Straight getElementById
document.getElementById('asdf')
ready
XUI
x$('#asdf')
ready
querySelector
document.querySelectorAll('#asdf')
ready
Riddle.js
r("#asdf")
ready
kQuery
uu.query("#asdf");
ready
Zepto
Zepto('#asdf')
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.