From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Bill Wendling <morbo@google.com>,
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: Thu, 11 Feb 2021 10:01:09 -0300 [thread overview]
Message-ID: <20210211130109.GD1131885@kernel.org> (raw)
In-Reply-To: <CAEf4Bzap_SYhtQdLF8bMwVeag=8CGqpcnRFb=MtZX7CB7FwSYQ@mail.gmail.com>
Em Wed, Feb 10, 2021 at 05:31:48PM -0800, Andrii Nakryiko escreveu:
> 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);
> > > ?
> > 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? :)
Yeah, I agree, faster is better, please make it so :-)
- Arnaldo
next prev parent reply other threads:[~2021-02-11 13:05 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
2021-02-11 13:01 ` Arnaldo Carvalho de Melo [this message]
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=20210211130109.GD1131885@kernel.org \
--to=acme@kernel.org \
--cc=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 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 NNTP newsgroup(s).