However, even in your results, the difference is less than 200 nanoseconds, which usually isn't a problem since your function is much more expensive in practice. i.e., you don't care about the difference between 10,000 nanoseconds and 10,200 nanoseconds. The only case where this might be a problem is if you are repeatedly calling a cheap function, although in that case it is probably more effective to improve the caller side. If this applies to you, I recommend posting a new question (maybe
CodeReview is better in this case). —
ken 51 secs ago