promise comparisons (v104)

Revision 104 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://raw.github.com/kriskowal/q/v1/q.js"></script><script src="https://raw.github.com/cujojs/when/master/when.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://raw.github.com/tildeio/rsvp.js/master/browser/rsvp.js"></script>
<script src="https://raw.github.com/jkroso/Laissez-faire/master/dist/Laissez-faire.min.js"></script>

<script>module = { exports: {} } // for avow</script>
<script src="https://raw.github.com/briancavalier/avow/master/avow.js"></script>
<script>avow = module.exports</script>

Test runner

Ready to run.

Testing in
TestOps/sec
q
// async test
var d = Q.defer()
d.promise.then(function done() {
  deferred.resolve()
})
d.resolve()
ready
when
// async test
var d = when.defer()
d.then(function done() {
  deferred.resolve()
})
d.resolve()
ready
jquery
// async test
var d = $.Deferred()
d.then(function done() {
  deferred.resolve()
})
d.resolve()
ready
RSVP
// async test
var p = new RSVP.Promise
p.then(function done() {
  deferred.resolve()
})
p.resolve()
ready
Laissez-faire
// async test
var p = new Promise
p.then(function done() {
  deferred.resolve()
})
p.resolve()
ready
avow
// async test
var v = avow()
v.promise.then(function done() {
  deferred.resolve()
})
v.fulfill()
ready

Revisions

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