I do not know for sure, but I would expect the switch-statement to be the fastest for the reason explained here, i.e. constant lookup time through implementation as a hashtable (for case statements with more than 5 items, that is).
Creating a new int[]
for one .Contains
seems very inefficient, but you might work around that with a constant field. Also, the method will have to iterate over all elements (worst case), so it is probably the least favorable option performance wise.
The if cascade might beat switch if in almost every case the first condition is correct, since it won't have to evaluate anything after that has been determined.
That being said, I'd usually go with an array, just because it reads nicely and is easily changed. The performance gains are usually moot.