unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <Szabolcs.Nagy@arm.com>
To: Florian Weimer <fweimer@redhat.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: Optimizing hash table lookup in symbol binding
Date: Mon, 18 Nov 2019 17:09:28 +0000	[thread overview]
Message-ID: <0dca7a5c-fc7b-8aa9-48cf-338e5b2c313f@arm.com> (raw)
In-Reply-To: <87lfsd477i.fsf@oldenburg2.str.redhat.com>

On 18/11/2019 13:58, Florian Weimer wrote:
> My primary interest was the % operator because it turns out that it
> actually shows up in some profiles stressing symbol binding during
> program lookup.  In most cases, however the search for the right mapping
> dominates and the preceding bitmask check fails most of the time.  But
> with shallow library dependencies, we can end up in a situation where
> the division actually matters.
> 
> Strategies for optimizing integer division are discussed in Hacker's
> Delight and here:
> 
> <http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html>
> <http://ridiculousfish.com/blog/posts/labor-of-division-episode-iii.html>
> 
> (I have written to the author to get some of the math fixed in minor
> ways, but I think the general direction is solid.)
> 
> The algorithm from the first episode looks like this:

note that _itoa.c already uses something like this.

(i think the itoa code is unnecessary: there is no reason
for optimizing anything but base 10 and 16, and the compiler
can do a better job at those than trying something at runtime,
but you may look at that implementation if it's any better).

  reply	other threads:[~2019-11-18 17:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 13:58 Optimizing hash table lookup in symbol binding Florian Weimer
2019-11-18 17:09 ` Szabolcs Nagy [this message]
2019-11-18 17:34   ` Florian Weimer
2019-11-21  1:55 ` Carlos O'Donell
2019-11-21 13:24   ` Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2019-11-18 21:57 Wilco Dijkstra
2019-11-19  9:15 ` Szabolcs Nagy
2019-11-19 11:56   ` Florian Weimer

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0dca7a5c-fc7b-8aa9-48cf-338e5b2c313f@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.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).