Seems native promises (with async await) give impressive performance. Fresh benchmarks on node 12:
results for 10000 parallel executions, 1 ms per I/O op
file time(ms) memory(MB)
callbacks-baseline 136 26.98
callbacks-suguru03-neo-async-waterfall 173 40.55
callbacks-caolan-async-waterfall 182 46.45
promises-bluebird-generator 193 31.79
promises-native-async-await 227 47.27
promises-lvivski-davy 231 89.84
promises-bluebird 235 48.86
promises-cujojs-when 246 62.32
generators-tj-co 256 56.29
promises-ecmascript6-native 267 67.10
promises-then-promise 298 72.26
promises-tildeio-rsvp 350 86.40
promises-calvinmetcalf-lie 430 139.95
promises-dfilatov-vow 464 131.59
promises-obvious-kew 558 170.41
observables-pozadi-kefir 581 137.09
streamline-generators 591 79.81
promises-medikoo-deferred 641 133.27
observables-Reactive-Extensions-RxJS 825 229.35
streamline-callbacks 847 132.60
promises-kriskowal-q 2336 400.62
observables-caolan-highland 2474 462.77
observables-baconjs-bacon.js 3658 805.42
Platform info:
Linux 4.19.34-1-MANJARO x64
Node.JS 12.0.0
V8 7.4.288.21-node.16
Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz ร 6
Maybe it's time to drop bluebird within of https://github.com/moleculerjs/moleculer/issues/433
You are right, but Node 12 is fresh and not LTS. Lot of developer uses Node 8,10. I think we can drop only in ~v0.15
Node 12 will be LTS on 2019-10-XX. Will be very nice to see what the worker_threads will give to the project (when stable).
@icebob any news about this issue ?
No any news.
Node 10
Platform info:
==============
Windows_NT 6.1.7601 x64
Node.JS: 10.16.0
V8: 6.8.275.32-node.52
Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz ร 8
Suite: Promise vs BlueBird vs Aigle vs await
โ No promise* 169,827,247 rps
โ ES6 Promise.resolve* 11,274,951 rps
โ ES6 new Promise* 11,719,615 rps
โ Bluebird Promise.resolve* 5,079,560 rps
โ Bluebird Promise.resolve + 5 x then* 1,105,344 rps
โ Bluebird new Promise* 7,109,401 rps
โ Aigle Promise.resolve* 12,550,337 rps
โ Aigle Promise.resolve + 5 x then* 3,226,746 rps
โ Aigle new Promise* 8,765,586 rps
โ await* 7,436,999 rps
โ Aigle Promise.resolve + 5 x then* 2,344,155 rps
Node 12
Platform info:
==============
Windows_NT 6.1.7601 x64
Node.JS: 12.14.1
V8: 7.7.299.13-node.16
Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz ร 8
Suite: Promise vs BlueBird vs Aigle vs await
โ No promise* 146,991,741 rps
โ ES6 Promise.resolve* 12,495,557 rps
โ ES6 new Promise* 12,622,663 rps
โ Bluebird Promise.resolve* 5,342,943 rps
โ Bluebird Promise.resolve + 5 x then* 1,200,959 rps
โ Bluebird new Promise* 5,779,400 rps
โ Aigle Promise.resolve* 11,233,806 rps
โ Aigle Promise.resolve + 5 x then* 2,700,589 rps
โ Aigle new Promise* 6,978,561 rps
โ await* 9,412,061 rps
โ Aigle Promise.resolve + 5 x then* 3,090,279 rps
I think it's very straightforward. We should drop Bluebird because it's 2.5x slower than the native built-in Promise
Most helpful comment
You are right, but Node 12 is fresh and not LTS. Lot of developer uses Node 8,10. I think we can drop only in ~v0.15