3 ms·
I constantly use `.map` and `.reduce` out of bluebird. I'm not sure I will replace these soon, since it's out of the Promise A+ specs. As a matter of fact, doe
by drinchev 9y ago
I constantly use `.map` and `.reduce` out of bluebird. I'm not sure I will replace these soon, since it's out of the Promise A+ specs.
As a matter of fact, does anyone have a benchmark of the new nodejs 8's promise implementation against bluebird, because I so far bluebird was faster than the native implementation.
- l1ambda 9y agoJust ran it: https://gist.github.com/llambda/aa44d2d44b8356e02f12493ee6e6d27e https://gist.github.com/llambda/aa44d2d44b8356e02f12493ee6e6...
- rattray 9y agoIt's not entirely clear how to interpret that; can you provide a summary?
- spion 9y agoThe short story is that native promises are faster now except for the "promisification" part. The benchmark was designed for realistic use in a node environment, where most of the libraries come callback based. Because of that a very fast "promisify" is really important. Native promises don't provide one so the naive implementation using standards-compatible API is quite slow. Bluebird's promisify is a lot faster since it relies on non-standard (as in non-ES6-standard) internals instead of using the promise constructor as an ES6-based promisifier would need to do. edit: on second thought, I haven't looked at the included `util.promisify` - it could be taking advantage of non-public internal V8 promise APIs.
- franciscop 9y agoIf I remember correctly there is a 4.5x speed up in the bundled V8 (chrome engine) implementation, making it on-par speed-wise with bluebird, however that is hardly your bottleneck anyway.