Re: performance of the swtich/case statements

2014-10-30 Thread Erich Dollansky
Hi, On Thu, 30 Oct 2014 12:24:33 +0800 bycn82 wrote: > Hi, > According to my understanding in Java programming, the compiler will aren't we talking about C here? Erich > automatically store the values into a table and jump to the correct > one according to the value only when the condition v

Re: performance of the swtich/case statements

2014-10-29 Thread bycn82
Hi, According to my understanding in Java programming, the compiler will automatically store the values into a table and jump to the correct one according to the value only when the condition values are in running number, for example. swtich(a){ case 1: code block 1 case 2: code block 2 case 3:

Re: performance of the swtich/case statements

2014-10-29 Thread Erich Dollansky
Hi, On Wed, 29 Oct 2014 22:39:34 +0800 "bycn82" wrote: > It is using the switch/case statement to make the code clear in the > > I am not a C programmer, so I am not clear how the switch/case will be > optimized by the compiler in FreeBSD. But I used to write a compiler > by myself and I use a

performance of the swtich/case statements

2014-10-29 Thread bycn82
Hi All, It is using the switch/case statement to make the code clear in the implementation, so it reminded me the question which I want to ask when I read the source of ipfw for the first time. It is about the performance of the switch/case statement. Sure the code of this table feature are run