Promise Speed Comparison

JavaScript performance comparison

Revision 2 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();
  window.NPromise = Promise; // preserve native promises (when overwrites)
</script>

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

<script src="http://www.bluejava.com/int/zousan-min.js"></script>
</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.then(function () { deferred.resolve() });
p.resolve(1);
pending…
Bluebird
// async test
var p = new BlueBird(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…
Native (built-in to browser)
// async test
var p = new NPromise(function (resolve, reject) {
      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