zepto vs belt

JavaScript performance comparison

Test case created by John Cockrell

Preparation code

<script src="//sjhcockrell.s3.amazonaws.com/downloads/belt.min.js"></script>
<script src="//zeptojs.com/zepto.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
    var a = [],
        i = -1,
        o = {};
   
    while (++i < 10000) {
       a[i] = i;
       o[i] = i;
    }
   
    function manipulate(value, key, obj) {
      return value * 11;
    }
};
</script>

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
Belt.forEach
B.forEach(a, manipulate);
pending…
Zepto.forEach
$.each(a, function(i,v){ manipulate(v,i); });
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