This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: switch statement performance
- From: <tm_gccmail at kloo dot net>
- To: Paul Vixie <paul at vix dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 21 Jan 2004 13:27:22 -0800 (PST)
- Subject: Re: switch statement performance
On Wed, 21 Jan 2004, Paul Vixie wrote:
> so if i have to compile stuff like this on non-gcc platforms (like native
> solaris and tru64 which a lot of bind users seem to have) i'll be at the
> mercy of their compilers?
I'm not entirely sure what you're asking, but I think so.
For example, the Renesas H8/300 compiler does not generate btrees for its
switches, and it generates linear compares.
The Javacard has a *huge* switch statement to dispatch to native code for
the Native Method Interface. Guess why the Javacard benchmark results for
native methods looked dismal when compiled with the Renesas compiler...
Toshi