4 ms·
Promises - the assumption here is that native promises are fast - this is amusing. Userland implementations like Bluebird promises are significantly faster than
by inglor 11y ago
Promises - the assumption here is that native promises are fast - this is amusing. Userland implementations like Bluebird promises are significantly faster than native promises. Not to mention the fact that converting an API to use promises is slow with native promises - a native `promisify` will have to be provided for Node, it's being worked on.
- skrebbel 11y agoHow often do you do async stuff per millisecond that this starts to matter? At least for browser stuff I really don't see the problem.
- wcummings 11y agoI've worked on node.js projects where certain promises implementations were too slow for the use-case
- iamstef 11y agoThe problem usually arises when the GC pressure introduced from the promises (often the intermediate promises) created by many active/concurrent tasks starts burning copious amounts of cycles. As your concurrency increases, a poor promise implementation starts burning copious amount of valuable cycles, often largely due to GC pressure. In the abstract this doesn't sound that bad, but when comparing well behaved implementations such as BlueBird, RSVP, When, ES6-Promise etc. with the current state, (July 3, 2015) native Promises, the difference is still staggering. As for the browser, a promise is a great way to handle async and often a great abstraction around a single potentially remote entity. As more ambitious applications are created, it isn't uncommon to have thousands or tens of thousands of these remote entities. Wouldn't it be nice, if the overhead of using the promise was negligible?
- spyder 11y agoYes, and also this: https://github.com/codemix/fast.js/tree/master https://github.com/codemix/fast.js/tree/master