question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bluebird 3.x performance in webpack

See original GitHub issue

This issue seems totally bizarre to me. I’m not sure whether to file it under webpack or Bluebird, but since it may be affecting other bluebird users I’ll file it here.

I’ve been finding that Bluebird’s performance in the browser has been pretty shoddy since I upgraded to bluebird 3.

In an effort to diagnose the problem, I started conducting some tests here: https://github.com/suprememoocow/bluebird-webpack-perf

The results are strange to say the least, but here’s some of what I’m seeing:

      module: {
        noParse: [
          /bluebird\/js\/browser\/bluebird\.js/
        ]
      },
      node: {
        console: false,
        global: false,
        process: false,
        Buffer: false,
        __filename: false,
        __dirname: false,
        setImmediate: false
      },
  • Changing these settings hasn’t helped.
  • Downgrading to Bluebird 2.x.x fixes the problem.

I’ll conduct some further tests and see if I can get to the bottom of the problem

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
suprememoocowcommented, Dec 1, 2015

Doing some profiling I noticed that bluebird is capturing long stack traces even though I have

Promise.config({
    warnings: false,
    longStackTraces: false, // <-- Turn off long stack traces
    cancellation: true
  });

This would explain why Chrome is getting the performance hit, but not Firefox or Safari.

Upon further investigation, it looks like the __DEBUG__ constant is being set to true for the build of js/browser/bluebird.js if you compare:

js/browser/bluebird.js:658:var debugging =!!(true || util.env("BLUEBIRD_DEBUG") ||

to the original source, here: https://github.com/petkaantonov/bluebird/blob/master/src/debuggability.js#L18

0reactions
suprememoocowcommented, Dec 1, 2015

@petkaantonov, I am using the npm module, which references js/browser/browser.js, which is currently built with __DEBUG__ set to true. #898 is my attempt at changing this.

References: require('bluebird') package.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise.config - Bluebird.js
Bluebird is a fully featured JavaScript promises library with unmatched performance.
Read more >
babel-loader - webpack
This package allows transpiling JavaScript files using Babel and webpack. Note: Issues with the output should be reported on the Babel Issues tracker....
Read more >
webpack/webpack - Gitter
I dont have devtool set but I have the SourceMapDevToolPlugin enabled and have it ... a really bizarre performance bug when using Webpack...
Read more >
Polyfilling Promises Using Bluebird in Webpack 2
Polyfilling Promises Using Bluebird in Webpack 2 · Install the dependencies · Configuring your Webpack · Bonus: jQuery and whatwg-fetch polyfill.
Read more >
Bluebird - npm
Full featured Promises/A+ implementation with exceptionally good performance. Latest version: 3.7.2, last published: 3 years ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found