Zepto vs. jQuery Mobile vs. jQmobi (v127)

Revision 127 of this benchmark created on


Description

Zepto vs. jQuery vs. jQmobi for getting an element by id (using latest versions, hosted on cl.ly)

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.0.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.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 boolean = true;

Test runner

Ready to run.

Testing in
TestOps/sec
Zepto
Zepto('#asdf')
ready
jQuery Mobile
jQuery('#asdf')
ready
jQMobi
jq('#asdf')
ready
el
el('#asdf')
ready
byId
byId('#asdf')
ready

Revisions

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