From: Alex Russell [[email protected]]

> On Wednesday, June 19, 2013, Ron Buckton wrote:

>> Promise#done() doesn’t have the overhead that Promie#then does (allocating a 
>> new chained Promise), so it is more efficient if you don’t need to chain.

> That is my only latent argument for #done(), and one that I think I agree 
> with Luke to re-visit at some later date. We can always add.

Given the heroics browsers pull for optimizing unused return values already, 
this argument never made much sense to me. E.g. Brendan has earlier mentioned 
SpiderMonkey taking a different code path if it sees `if (regExp.exec(...))`, 
which only returns a truthy result instead of computing the entire array. It 
seems like a trivial optimization to notice that nobody's using the return 
value of `then` and not create a promise to return.

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to