From: dewar@gnat.com (Robert Dewar)
To: gcc@gcc.gnu.org, jawalker@stl.quik.com
Subject: Re: Hashing of "switch/case" selections
Date: Thu, 28 Dec 2000 07:19:00 -0000 [thread overview]
Message-ID: <20001228151901.70EDA34D80@nile.gnat.com> (raw)
<<associated register loads, to be at least the equivalent of three test
and conditional branch instruction pairs. (no divide instructions -- I
am allergic to those).
>>
Conditional jumps can be extremely expensive if mispredicted as will happen
in this case (they can cost 10's of cycles), so your relative estimate of
efficiencies here is badly off for most modern architectures.
<<Just for peace of mind, the present tool (binary tree) handles most
situations in the most efficient manner, IMHO. Also, none of the
algorithms I found could guarantee a near-minimal, perfect Hash in
linear time. A few wild stabs in the dark often bring success. When
they do not, the binary tree is the reliable backup plan.
>>
Who cares if the compilation time algorithm is linear time, that's a
quite inappropriate criterion.
next reply other threads:[~2000-12-28 7:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-28 7:19 Robert Dewar [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-12-28 21:10 dewar
2000-12-28 22:41 ` Dave Korn
2000-12-28 7:15 Robert Dewar
2000-12-28 21:06 ` Dave Korn
2000-12-27 20:41 Andy Walker
2001-01-01 14:30 ` Nix
2001-01-04 1:39 ` Zack Weinberg
2001-01-05 10:54 ` Michael Meissner
2001-01-07 18:37 ` Andy Walker
2001-01-07 18:12 ` Andy Walker
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=20001228151901.70EDA34D80@nile.gnat.com \
--to=dewar@gnat.com \
--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).