taby said:
You're missing the point. In the event where it does matter, a 42-long if-else statement is generally slower than a function pointer. Like I said, look at Julia 4D 2. It proves my point.
True, I just wasn't referening to that. On this point we can agree, though its also very obvious. In the event of something that is not obvious, unless you account for the points I mentioned you are better off just not testing at all because you are going to come to the wrong conclusions. For example, the two numbers you posted previously for the code that I just viewed, are entirely meaningless. I'll do my own test again, but its very possible that for the function-pointer vs std::function, both will end up having the same performance when called, when done properly. And that is a significant difference to the results the your numbers suggested.
My other point would be to also never post performance-numbers without the associated code, but I'd digress.