4 ms·
Bluebird already has this, and is more efficient than native. But this is definitely a step forward.
by scrabble 10y ago
Bluebird already has this, and is more efficient than native. But this is definitely a step forward.
- m1sta_ 10y agoI'm not debating the point, but how is that possible?
- sotojuan 10y agoI'm not sure how it's possible but it's definitely not rare. Lodash' methods are faster than their respective native implementations (Lodash `map` > `Array.prototype.map`).
- STRiDEX 10y agohttp://programmers.stackexchange.com/questions/278778/why-are-native-es6-promises-slower-and-more-memory-intensive-than-bluebird http://programmers.stackexchange.com/questions/278778/why-ar... I'm not sure all of it still stands. Bluebird is in C. Native is in javascript. Edit: i'm wrong
- deleted 10y ago[deleted]
- bananaoomarang 10y agohttps://www.reaktor.com/javascript-performance-fundamentals-make-bluebird-fast/ https://www.reaktor.com/javascript-performance-fundamentals-...
- JaRail 10y agoAs a general answer, doing something simple in pure JS can be more efficient than the overhead associated with making a native call from JS. The costs are going to vary depending on how the JIT handles things. That's probably the best general reason though as to how it's possible.
- scrabble 10y agoAs I understand it, native promises don't make native system calls. They are still pure js. They are just implemented differently from Bluebird which optimizes for the most common use cases.