3 ms·
It is surprising to me that they recommend callbacks over promises! I had no idea that promises require higher CPU resources.
by barosl 12y ago
It is surprising to me that they recommend callbacks over promises! I had no idea that promises require higher CPU resources.
- spion 12y agoHmm, those are strange results indeed. I would not be surprised if those measurements were made a year ago. Back then, promises were really slow. But then bluebird came out and changed everything, and many of the other promise libraries followed suit. Most promise libs are now really lightweight (with the only remaining exception being Q). See https://gist.github.com/spion/6990910 https://gist.github.com/spion/6990910 ; http://spion.github.io/posts/why-i-am-switching-to-promises.html http://spion.github.io/posts/why-i-am-switching-to-promises.... ; https://github.com/spion/async-compare/blob/master/latest-results.md https://github.com/spion/async-compare/blob/master/latest-re... - For example, bluebird (and most other promise libraries today) have 2 to 3 times lower overhead than caolan's async and are comparable to the most hand-optimized raw callbacks.