Bluebird vs RSVP (v85)

Revision 85 of this benchmark created on


Description

A comparison of some of the most highly performant promise implementations. Now including Zousan (https://github.com/bluejava/zousan)!

Preparation HTML

<script src="http://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.js"></script>
<script src="https://cdn.jsdelivr.net/bluebird/latest/bluebird.min.js">
</script>
<script src="http://www.bluejava.com/int/zousan-min.js">
</script>
<script>

var BPromise = Promise.noConflict();
var RPromise = RSVP.Promise;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Bluebird
// async test
function make() {
  return new BPromise(function (resolve, reject) {
      resolve(1)
  })
}

make().then(function () { deferred.resolve() })
ready
RSVP
// async test
function make() {
  return new RPromise(function (resolve, reject) {
      resolve(1)
  })
}

make().then(function () { deferred.resolve() })
ready
Native
// async test
function make() {
  return new Promise(function (resolve, reject) {
      resolve(1)
  })
}

make().then(function () { deferred.resolve() })
ready
Zousan
// async test
var p = new Zousan();
p.then(function () { deferred.resolve() });
p.resolve(1);
ready
Sync Callback
(function (err, cb) {
  if (err) throw Error();
  else cb(1);
})(null, function (item) {
  return item;
})
ready
Thunk
(function () {
  return function () {
    return 1;
  }
})()()
ready
Async Callback
(function (err, cb) {
  if (err) throw Error();
  else setTimeout(cb, 0);
})(null, function () {
  return 1;
})
ready

Revisions

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