Promises / A+ Benchmark

JavaScript performance comparison

Revision 54 of this test case created by

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script>
<script>window.Bluebird = { Promise: Promise };</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/q.js/1.0.1/q.js"></script>
<script>
    window.define = function(factory) {
        try{ delete window.define; } catch(e){ window.define = void 0; } // IE
        window.when = factory();
    };
    window.define.amd = {};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/when/2.7.1/when.js"></script>

<script src="https://rawgit.com/rkatic/p/master/p.js"></script>
      
<script>
Benchmark.prototype.setup = function() {
  function addOne(x) {
    return x + 1;
  }
  
  Q.longStackJumpLimit = 0;

};
</script>

Preparation code output

<script>window.Bluebird = { Promise: Promise };</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/q.js/1.0.1/q.js"></script> <script> window.define = function(factory) { try{ delete window.define; } catch(e){ window.define = void 0; } // IE window.when = factory(); }; window.define.amd = {}; </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/when/2.7.1/when.js"></script> <script src="https://rawgit.com/rkatic/p/master/p.js"></script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Native
// async test
new Promise(function(resolve) {
  resolve(1)
}).then(function(value) {
  deferred.resolve()
});
pending…

Revisions

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

0 Comments