promise comparisons

JavaScript performance comparison

Revision 38 of this test case created by calvin

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="https://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

<script src="http://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.js"></script> <script src="https://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>

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
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.

0 Comments