trampoline(isEvenInner, 99999); // => false trampoline(isEvenInner, 99998); // => true
Why does a trampoline not improve performance? A couple of observations should be made about this trampoline implementation:
PS: Thanks for this js-drip, I was not aware of this concept.
I have to say, while I can see how this avoids the call stack, surely it just offloads performance issues somewhere else?
My gut feeling is that for functions that do not exceed the stack limit, execution would be much slower. Am I wrong? Is the difference significant?