3 ms·
Neither of your examples is doing what the parent suggested as an alternative, which is simply looping and counting rather than creating an anonymous function t
by nonameiguess 3y ago
Neither of your examples is doing what the parent suggested as an alternative, which is simply looping and counting rather than creating an anonymous function to repeatedly call. I doubt this makes an enormous difference in practice, but you can see your generated assembly doing all the argument passing and stack frame setup, which is extra instructions compared to just straight looping and counting.