Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attempt to require bluebird first #3

Conversation

ruimarinho
Copy link
Contributor

This is likely controversial, but in my opinion, if a developer has bluebird installed, we might as well take advantage of that fact, at least for now, considering that it is 40x faster than ES6 Promises.

See https://github.com/petkaantonov/bluebird/tree/master/benchmark and angular/angular.js#6697 (comment).

We can always switch back to the previous order when ES6 Promises are optimized in V8. I've tested the benchmarks on io.js and even with the V8 upgrade, native promises are still way slower than bluebird's implementation.

@coveralls
Copy link

Coverage Status

Coverage decreased (-11.11%) to 88.89% when pulling 2047b07 on seegno-forks:enhancement/try-bluebird-first into 652f574 on normalize:master.

@jonathanong
Copy link
Contributor

i had it this way before. unfortunately, if we added this back, we would have to change the name of the module =P

@jonathanong
Copy link
Contributor

people can vote on this though... don't really care

@ruimarinho
Copy link
Contributor Author

I had the same thought :P but I think it's fine, people are probably going after functionality and performance rather than the actual order of events.

@ruimarinho
Copy link
Contributor Author

@jonathanong would it make sense to allow some option like { preferNative: true } so that at the application level developers can prefer a native implementation but if not passed, cascades through the top Promises/A+ libs and then falls back to native anyway ( bluebird > es6-promise > native)?

I'm particularly interested in experimenting the new unhandled rejection tracking support on io.js and bluebird already has hooks for that.

@jonathanong
Copy link
Contributor

i'm ambivalent. anyone care about this?

@jonathanong
Copy link
Contributor

@fengmk2
Copy link

fengmk2 commented Feb 12, 2015

@jonathanong agree! Native Promise has memory gc reason and current can't be fix tj/co#180 .

@fengmk2
Copy link

fengmk2 commented Feb 12, 2015

or new module name bluebird-or-native ...

@jonathanong
Copy link
Contributor

@fengmk2 good reason!

@jonathanong
Copy link
Contributor

1.2.0!

@dead-horse
Copy link
Member

haha. I always do global.Promise = require('bluebird') for now.

@ruimarinho ruimarinho deleted the enhancement/try-bluebird-first branch February 17, 2015 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants