2 ms·
> In fact he is right. Was he, though? I mean, yeah having to push and pop a call stack does indeed require more work than not having to do that. However, comp
by chipdart 2y ago
> In fact he is right.
Was he, though? I mean, yeah having to push and pop a call stack does indeed require more work than not having to do that. However, compilers can and do inline and optimize out function calls.
And what's the real performance impact of calling functions a constant number of times outside of the hot path? Is an untestable spaghetti salad of things better than a few hypothetical push and pops?
There's wisdom behind Knuth's remarks on premature optimization.