public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Korn" <dave.korn@artimi.com>
To: "'Zack Weinberg'" <zack@codesourcery.com>,
	"'Nick Clifton'" <nickc@redhat.com>
Cc: "'Alan Modra'" <amodra@bigpond.net.au>,
	"'Ben Elliston'" <bje@au1.ibm.com>, <binutils@sources.redhat.com>
Subject: RE: PATCH: use hashtab for pseudo op table
Date: Thu, 05 May 2005 17:58:00 -0000	[thread overview]
Message-ID: <SERRANOIA3EEmYDKFJ200000245@SERRANO.CAM.ARTIMI.COM> (raw)
In-Reply-To: <87k6mdd2a3.fsf@codesourcery.com>

----Original Message----
>From: Zack Weinberg
>Sent: 05 May 2005 18:13

> The auto-resizing certainly would be nice to have.  I'm not just
> bringing up the indirect function call penalty as a hypothetical,
> though; over in GCC we got measurable speedups by switching back to a
> custom hash table (libcpp/symtab.c) for identifier lookups.

  You mentioned this before in the context of iterators, but surely passing
a function pointer into an iterator routine and getting that function called
once per hashtable item is no worse than having an iterator, calling a
function (not through a pointer admittedly) to advance it once per hashtable
item, and then processing the thing inline?  There's still one function call
per entry and one block of code that loops over all entries calling that
function.....

>  I don't
> know whether the assembler's parse pass bottlenecks in the same places
> that GCC's parsers do, but it wouldn't surprise me -- parsers is
> parsers.

  LOL, that is _soooooo_ not a valid conclusion!  The complexity, structure,
architecture, implementation and behaviour of a backtracking parser that can
make sense of C++ in no way compares to the simple minded "Every line begins
with an optional label, then has an opcode, then some operands, and might
end with a comment" style parsing of gas!  Parsers most definitely is not
just parsers: some of them is parsers, and some is just crude tokenizers and
string matchers, and some is absolute monsters!

> I'm also concerned with hashtab.c's interface being significantly
> messier. 

> That's both less lucid and less efficient.  And it's not practical to
> hide the mess in wrapper functions, because you have to get the type
> of 'key' right ... gas/config/tc-arm.c has about a dozen little
> structures stored in hash tables.

  So, perhaps a slight bit of work on the libiberty hashtab api, to offer a
few interfaces that take a) NUL-terminated strings b) fixed-size structs and
maybe even c) variable sized structs with parameters specifying an offset
and size within the struct where the sizeof the struct can be found, would
make you reconsider?

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

  reply	other threads:[~2005-05-05 17:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-29  8:21 Ben Elliston
2005-04-29  8:52 ` Zack Weinberg
2005-05-05 10:00   ` Nick Clifton
2005-05-05 10:57     ` Alan Modra
2005-05-05 11:46       ` Nick Clifton
2005-05-05 12:37         ` Alan Modra
2005-05-05 17:14         ` Zack Weinberg
2005-05-05 17:58           ` Dave Korn [this message]
2005-05-05 18:59             ` Zack Weinberg
2005-05-05 19:44               ` DJ Delorie
2005-05-05 20:10               ` Richard Henderson
2005-05-06  6:17                 ` Zack Weinberg
2005-05-06  6:44                   ` Richard Henderson
2005-05-06  7:36                     ` Zack Weinberg
2005-05-05 19:20           ` DJ Delorie
2005-05-17 13:19         ` Nick Clifton
2005-05-05 15:24       ` H. J. Lu

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=SERRANOIA3EEmYDKFJ200000245@SERRANO.CAM.ARTIMI.COM \
    --to=dave.korn@artimi.com \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=bje@au1.ibm.com \
    --cc=nickc@redhat.com \
    --cc=zack@codesourcery.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).