Promise Speed Comparison

JavaScript performance comparison

Revision 7 of this test case created by Glenn

Preparation code

<script src="https://cdn.jsdelivr.net/bluebird/2.9.25/bluebird.min.js"></script>

<script>
  var Bluebird = Promise.noConflict();
</script>

<script src="http://www.bluejava.com/int/zousan-min-1.0.2.js"></script>
</script>

<script>
 window.NPromise = window.Promise; // Preserve native promises
</script>

<script src="https://rawgit.com/cujojs/when/master/es6-shim/Promise.js"></script>

<script src="https://rawgit.com/timjansen/PinkySwear.js/master/pinkyswear.min.js"> </script>

<script src="https://rawgit.com/wizardwerdna/covenant/master/covenant.js"> </script>
    

Preparation code output

</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
Zousan
// async test
var p = new Zousan();
p.resolve(1);
p.then(function() { deferred.resolve() });
pending…
Bluebird
// async test
var p = new Bluebird(function (resolve, reject) {
      resolve(1)
  });
p.then(function() { deferred.resolve() })
pending…
Native (built-in to browser)
// async test
var p = new NPromise(function (resolve, reject) {
      resolve(1)
  });
p.then(function() { deferred.resolve() })
pending…
When
// async test
var p = new Promise(function (resolve, reject) {
      resolve(1)
  });
p.then(function() { deferred.resolve() })
pending…
PinkySwear.js
// async test
var p = pinkySwear();
p(true, []);
p.then(function() { deferred.resolve() })
pending…
covenant
// async test
var p = new Covenant.Core()
p.resolve(1);
p.then(function() { deferred.resolve() })
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.

0 Comments