1) What version of bluebird is the issue happening on? 3.4.6
2) What platform and version? (For example Node.js 0.12 or Google Chrome 32) IE11
Promises work slowly in IE11. I have found this issue also, and as offered solution - use minified version of Bluebird. And yes, it helped, but could you, please, explain the core issue of this? And why it works fast with minified version?
https://github.com/systemjs/systemjs/issues/1220
Thank you!
You almost certainly have long stack traces enabled which should be a development only feature because although they are incredibly useful during development they absolutely destroy promise performance. The minified build disables them.
@phpnode, according to documentation, I can switch them off by setting environment variables:
NODE_ENV=production
BLUEBIRD_LONG_STACK_TRACES=0
BLUEBIRD_WARNINGS=0
BLUEBIRD_DEBUG=0
I did it here: https://github.com/yankouskia/bluebird_slowness
Here is the example with webpack, where I have 2 ways to get bundle (production and development)
Also, I have html file DIRECT_EXAMPLE.html, in which I tried to include development and minified version of bluebird according to documentation here: http://bluebirdjs.com/docs/install.html
And I got next results:




Could you please, explain such result?
Thanks.
If you downloaded the non-minified version, it has hard-coded long stack traces enabled (see line 691). The downloads are meant to be used without any package manager with direct script tags, if you have package manager then those environment variables should work.
@petkaantonov
there is function env in source code:
function env(key, def) {
return isNode ? process.env[key] : def;
}
isNode is false, because code is executed in browser, but global constants are configured at compile time. So I will never get true result. (typeof process will be ok, but classString(process).toLowerCase() === "[object process]" will fail)
Why do you need isNode here? I removed it and it worked correctly. Are there any reasons or I could create PR and fix it?
And moreover I don't see why def is needed here as seems it isn't used anywhere
@petkaantonov , @benjamingr , @spion could anybody help with this, please? Or review PR?
Thanks
@petkaantonov, @benjamingr, @spion,
guys, could you please merge fix for this issue?
Guys?
None of us are going to merge this until we've asserted this works, I've tested it a bit and left comments but I'm still not sure - it seems to work.
I tested it last weekend, but a unit test would be nice. Also, @petkaantonov has been busy recently - he'll probably merge in the coming days.
@benjamingr , could you please publish to npm updated version of bluebird? Thanks!
Guys? :)
Could we expect this would be published as soon as possible?
published 3.4.7
@petkaantonov , thank you!
Most helpful comment
@phpnode, according to documentation, I can switch them off by setting environment variables:
I did it here: https://github.com/yankouskia/bluebird_slowness
Here is the example with webpack, where I have 2 ways to get bundle (production and development)
Also, I have html file
DIRECT_EXAMPLE.html, in which I tried to include development and minified version of bluebird according to documentation here: http://bluebirdjs.com/docs/install.htmlAnd I got next results:




Could you please, explain such result?
Thanks.