|
I don't know what would be faster on C# because I don't know how switches or the indirect function calls you mention are implemented. I just know that theoretically a switch can be faster than an indirect function call because there's less return overhead, more stack frame/register consistency (frame and calling convention overhead) and better potential for optimization. If the function table performs better then the compiler is not doing a good enough job.
I wrote a big post on this once but all I could find was one that was basically like this one :/
|