Q vs rsvp (v8)

Revision 8 of this benchmark created by Kyriakos-Ioannis Kyriakou on


Preparation HTML

<!-- Q -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/q.js/0.9.6/q.min.js"></script>

<!-- RSVP -->
<script src="http://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Q
// async test
var d = Q.defer()
var code = 'q' + Math.random();

function eventFunc(e) {
  if (e.data === code) {
    window.removeEventListener('message', eventFunc);
    d.resolve();
  }
}
window.addEventListener('message', eventFunc);
d.promise.then(function() {
  deferred.resolve()
})
window.postMessage(code, '*');
ready
RSVP
// async test
var d = RSVP.defer();
var code = 'rsvp' + Math.random();

function eventFunc(e) {
  if (e.data === code) {
    window.removeEventListener('message', eventFunc);
    d.resolve();
  }
}
window.addEventListener('message', eventFunc);
d.promise.then(function() {
  deferred.resolve()
})
window.postMessage(code, '*');
ready

Revisions

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