2 ms·
I would also like proper tail call optimization but it's very rare I need to do long loops in CPS style without a call in there that will reset the stack. And i
by BenoitEssiambre 7y ago
I would also like proper tail call optimization but it's very rare I need to do long loops in CPS style without a call in there that will reset the stack. And in any case, you don't need to call nextTick every iteration. Javascript stacks are over 10000 deep nowadays. If you need performance, call nextTick every 1000 iteration and you will be fine. Note that promises force the stack to be reset all the time and you have no choice to take the performance hit.