kriskowal/q — pull request #95 by ForbesLindesay (2012-07-29 18:27:39+00:00)
Title: Speed up Q.all when not all values are promises

In the case where either:

a) Not all values in the input array are promises (many orders of magnitude improvement)
b) Some of the promises are already resolve (about twice as quick).

It does this by not waiting till the next turn of the event loop when it is un-necessary to do so.

Deferred will already ensure that the overall behaviour of all is correct with regard to resolving exactly once.

I've also tested this when all values are promises and the overhead is tiny (for Q.all on 10,000 promises it takes about `1500ms` with the old `Q.all` and `1550ms` with the new `Q.all`