cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Improve reduce() and lift() perf. #398

Closed briancavalier closed 9 years ago

briancavalier commented 9 years ago

Extract fast argument traversal to lib/apply, use in lift/call/apply variants, and in reduce/reduceRight.

briancavalier commented 9 years ago

The when.reduce perf increases with the size of the input array. For small arrays, there's little to no diff, but for larger arrays (10k, 100k, or more) it can be significant (2x).

For when.lift and when.try, it's about a 4x perf increase