promise comparisons (v39)

Revision 39 of this benchmark created on


Description

This is a comparison of different promise libraries, performing the most basic tasks of creating a promise, adding a then handler and then resolving the promise.

Preparation HTML

<script src="https://rawgithub.com/NobleJS/setImmediate/master/setImmediate.js">
</script><script src="https://rawgithub.com/calvinmetcalf/lie/noConflic/dist/lie.js"></script>
<script>lie.noConflict();</script>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1/dojo/dojo.xd.js">
</script>
<script src="http://calvinmetcalf.github.io/promise-jsperf/javascripts/q.js">
</script>
<script src="http://calvinmetcalf.github.io/promise-jsperf/javascripts/jQuery.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="http://calvinmetcalf.github.io/promise-jsperf/javascripts/when.js">
</script>
<script src="http://calvinmetcalf.github.io/promise-jsperf/javascripts/rsvp.js">
</script>


<script>
  if (typeof(require) == 'undefined') {
    require = null;
  }
  exports = {};
</script>
<script src="https://rawgithub.com/kriszyp/promised-io/master/promise.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
lie
// async test
var d = lie();
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
ready
when
// async test
var d = when.defer()
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
ready
jquery
// async test
var d = $.Deferred()
d.then(function() {
  deferred.resolve()
})
d.resolve()
ready
RSVP
// async test
var d = RSVP.defer();
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
ready
q
// async test
var d = Q.defer()
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
ready

Revisions

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