Hacker News new | past | comments | ask | show | jobs | submit login

When I say performance, I mean throughput not latency. That's why there are no latency benchmarks.

Also, in your benchmark you do output in bluebird section with console.log. Maybe try http://jsperf.com/promise-comparisons/50.




that one uses window.addEventListner which gives an advantage to libraries that prefer that to ones that use that one first over ones that use messageChannel first. here is a fixes one[1], looks like everything using mutation observer is about the same throughput.

My background is that I've been trying to create a promise library that just creates without also being underscore for promises [1]

What sort of performance are we talking about that we are able to test without really measuring other things. For instance when was able to dominate many of the perfs by actually doing many of them synchronously in cases where other libraries would force it async.

[1]: http://jsperf.com/promise-comparisons/59 [2]: https://github.com/calvinmetcalf/lie


That's not throughput. You are running exactly 1 promise in parallel at a time and waiting for it to be resolved.

However, on node.js you can have more than 1 client served by your server. For instance, your server could have e.g. 10000 promises/callbacks/generators active at a time. Take a look at how different solutions handle that https://github.com/spion/async-compare/blob/master/latest-re....

The results don't change at all if we for example increase latency of I/O by an order of magnitude - that's why latency is not an interesting metric for this use case. It's pretty intuitive, all the 10000 users will just get their results 9ms later but the fact that we could even handle them in the first place without crashing our server matters.

----------

You are right that for your use-case, pretty much the only thing that matters is what implementation is used for queuing async calls since it's such a tight bottleneck. Bluebird attempts to use mutation observer if available.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: