View Single Post
Old July 1st, 2009   #74 (permalink)
@ruantec
Emu author
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Austria (originally from Dominican Republic)
Posts: 2,380
Quote:
Originally Posted by Exophase View Post
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 :/
I have to agree with you there at 100% sadly C# doesn´t like switches at all/that much but there is much room for optimization there and still better than indirect function call or loops.
__________________

Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
@ruantec is offline   Reply With Quote