[Mono-list] [Off-topic] "if else" or "switch" ?

Marcus mathpup@mylinuxisp.com
Sun, 17 Oct 2004 17:20:21 -0500


I will try to dig up the tests or to recreate them.

You are probably correct that this is not a very large problem in practice. As 
I recall, I had to make the number of iterations quite large to see a 
substantial difference in time.

On the other hand, I did this test because I have a program that needs to 
perform a large number of three-way decisions like this.

Marcus


On Sunday 17 October 2004 9:45 am, Paolo Molaro wrote:

> We may add the code to turn a switch with less than 3-4 destinations
> to a if/else sequence, but I'm not sure if this is really a speed
> problem in practice. Marcus reported behaviour may be due to different IL
> code generated by the compiler: I'd like to see the actual IL code
> to determine what actually caused the performance issue he reported.