promise comparisons

JavaScript performance comparison

Revision 38 of this test case created by calvin

Info

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 code

<script src="https://rawgithub.com/calvinmetcalf/lie/1.3.0/dist/lie.noConflict.js"></script><script src="http://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/q.js/0.9.6/q.min.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://rawgithub.com/cujojs/when/master/when.js">
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
lie
// async test
var d = lie();
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
pending…
when
// async test
var d = when.defer()
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
pending…
RSVP
// async test
var d = RSVP.defer();
d.promise.then(function() {
  deferred.resolve()
})
d.resolve()
pending…
q
// async test
var d = Q.defer()
d.promise.then(function() {
  deferred.resolve()
})
d.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. Here’s a list of current revisions for this page:

0 comments

Add a comment