From: "Zack Weinberg" <zackw@stanford.edu>
To: Andy Walker <jawalker@stl.quik.com>
Cc: GCC general mailing list <gcc@gcc.gnu.org>
Subject: Re: Hashing of "switch/case" selections
Date: Thu, 04 Jan 2001 01:39:00 -0000 [thread overview]
Message-ID: <20010104013910.F12948@wolery.stanford.edu> (raw)
In-Reply-To: <3A4AC4FC.35E70BEE@stl.quik.com>
On Wed, Dec 27, 2000 at 10:43:40PM -0600, Andy Walker wrote:
[much interesting stuff]
> My experience as a programmer is that programs are almost never written
> with switches to more than a few hundred cases. I personally have never
> seen one. More than that, and the programmer finds a more efficient,
> more readable, more maintainable solution, and he can do so because he
> has a deep knowledge of the problem that is unavailable to the
> compiler. My seat-of-pants estimate is that 400 cases is a good, maybe
> even high, maximum for Hash evaluations. A program containing a switch
> statement with more than 400 cases in it probably has enough other
> severe design problems that it will never be worth running anyway.
This is true in my experience for code written by humans, but not
necessarily for machine-generated code. Take a look at insn-attrtab.c
in your GCC build directory, or at cp/parse.c in the source tree.
zw
next prev parent reply other threads:[~2001-01-04 1:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-27 20:41 Andy Walker
2000-12-27 21:33 ` I have found an ICE Magnus Fromreide
2001-01-01 14:30 ` Hashing of "switch/case" selections Nix
2001-01-04 1:39 ` Zack Weinberg [this message]
2001-01-05 10:54 ` Michael Meissner
2001-01-07 18:37 ` Andy Walker
2001-01-07 18:12 ` Andy Walker
2000-12-28 7:15 Robert Dewar
2000-12-28 21:06 ` Dave Korn
2000-12-28 7:19 Robert Dewar
2000-12-28 21:10 dewar
2000-12-28 22:41 ` Dave Korn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010104013910.F12948@wolery.stanford.edu \
--to=zackw@stanford.edu \
--cc=gcc@gcc.gnu.org \
--cc=jawalker@stl.quik.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).