From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Bill Wendling <morbo@google.com>
Cc: dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Subject: Re: [PATCH] dwarf_loader: use a better hashing function
Date: Wed, 10 Feb 2021 17:31:48 -0800 [thread overview]
Message-ID: <CAEf4Bzap_SYhtQdLF8bMwVeag=8CGqpcnRFb=MtZX7CB7FwSYQ@mail.gmail.com> (raw)
In-Reply-To: <CAGG=3QW0zuXUcpkcZqnaZS77EABEshhPtUCTr71dDDMuL1oMZQ@mail.gmail.com>
On Wed, Feb 10, 2021 at 5:24 PM Bill Wendling <morbo@google.com> wrote:
>
> On Wed, Feb 10, 2021 at 4:00 PM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
> >
> > On Wed, Feb 10, 2021 at 3:25 PM Bill Wendling <morbo@google.com> wrote:
> > >
> > > This hashing function[1] produces better hash table bucket
> > > distributions. The original hashing function always produced zeros in
> > > the three least significant bits.
> > >
> > > The new hashing funciton gives a modest performance boost.
> > >
> > > Original New
> > > 0:11.41 0:11.38
> > > 0:11.36 0:11.34
> > > 0:11.35 0:11.26
> > > -----------------------
> > > Avg: 0:11.373 0:11.327
> > >
> > > for a performance improvement of 0.4%.
> > >
> > > [1] From Numerical Recipes, 3rd Ed. 7.1.4 Random Hashes and Random Bytes
> > >
> >
> > Can you please also test with the one libbpf uses internally:
> >
> > return (val * 11400714819323198485llu) >> (64 - bits);
> >
> > ?
> >
> > Thanks!
> >
> It's giving me a running time of ~11.11s, which is even better. Would
> you like me to submit a patch?
faster is better, so yeah, why not? :)
>
> -bw
next prev parent reply other threads:[~2021-02-11 1:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 23:23 [PATCH] dwarf_loader: use a better hashing function Bill Wendling
2021-02-10 23:59 ` Andrii Nakryiko
2021-02-11 1:24 ` Bill Wendling
2021-02-11 1:31 ` Andrii Nakryiko [this message]
2021-02-11 13:01 ` Arnaldo Carvalho de Melo
2021-02-12 6:55 ` Bill Wendling
2021-02-12 12:35 ` Arnaldo Carvalho de Melo
2021-02-12 8:01 ` [PATCH v2] " Bill Wendling
2021-02-12 12:37 ` Arnaldo Carvalho de Melo
2021-02-12 12:39 ` Arnaldo Carvalho de Melo
2021-02-12 20:14 ` Bill Wendling
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='CAEf4Bzap_SYhtQdLF8bMwVeag=8CGqpcnRFb=MtZX7CB7FwSYQ@mail.gmail.com' \
--to=andrii.nakryiko@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=morbo@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.