-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chuck,
On 4/22/16 12:54 PM, Caldarale, Charles R wrote: >> From: David kerber [mailto:dcker...@verizon.net] Subject: Re: OT >> if/else or not if/else > >> But I would add that if the conditions can be reduced to >> enumerations, a Switch would be even faster. > > Actually, a good compiler should generate the same code for switch > and if ... else if, assuming the boolean expressions used with the > ifs are compatible with a switch operand. Do you know of such a compiler (for Java)? I've never seen a compiler generate a switch bytecode when a "switch" statement wasn't present in the original Java source. My experience has been that the Java compiler itself is fairly dumb, and the most optimizations seem to be performed by the JIT which knows much more about what's really going to happen than the Java-bytecode compiler. (Admittedly, I haven't played with this in quite a while, and I never really did a survey of compilers.) - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlceJt0ACgkQ9CaO5/Lv0PCwsQCcCZTs9ktsGh1m6RaetdAt5Iyd LyYAmQG2HMoz1A6ps5oZPQ65IaLAY/yJ =FKW2 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org