Promise vs BlueBird

JavaScript performance comparison

Revision 7 of this test case created by Micah Thomas

Preparation code

<script src="//cdn.jsdelivr.net/npm/bluebird@3.5.5/js/browser/bluebird.min.js"></script>
<script>
// Make sure to restore Promise to native
window.Bluebird = window.Promise.noConflict()
</script>
    

Preparation code output

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
BlueBird
function B() {
  return new Bluebird((res, rej) => {
    res('test')
  })
}

B().then(result => {
  if (result !== 'test') {
    throw new Error('Bad result')
  }
})
pending…
Promise
function A() {
  return new Promise((res, rej) => {
    res('test')
  })
}

A().then(result => {
  if (result !== 'test') {
    throw new Error('Bad result')
  }
})
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