DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pragash Vijayaragavan <pxv3620@rit.edu>
To: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Minseok Kwon <mxkvcs@rit.edu>
Subject: Re: [dpdk-dev] cuckoo hash in dpdk
Date: Wed, 23 Aug 2017 16:39:46 -0400	[thread overview]
Message-ID: <CANp7S21RjYw22wuBjVsGy3qfCnbnjuggE-EMRZQGxW5Kcr5W6Q@mail.gmail.com> (raw)
In-Reply-To: <CANp7S21_OrK+t-yNUDGgvXk_QnDAUcE7FRExJPpH4JBx5OD1+A@mail.gmail.com>

And yea, mod will take only 1 Clock cycle that way :)

Also if divisor is a power of 2,  a / b  can be done like

 ( Given a is unsigned, a > b and since our hash values are greater than 0,
a is our hash value, b the power of 2)

while(b != 1) {
   a >>= 1;
   b >>= 1;
}

 which is less clock cycles than normal division i guess :)




Thanks,

Pragash Vijayaragavan
Grad Student at Rochester Institute of Technology
email : pxv3620@rit.edu
ph : 585 764 4662


On Wed, Aug 23, 2017 at 4:20 PM, Pragash Vijayaragavan <pxv3620@g.rit.edu>
wrote:

> Hi ,
>
> The performance will depend on the time taken for calculating the hash1
> and hash2 values for each lookup.
>
> Can i know which hash functions are used to calculate the hash values for
> each incoming key. We use CRC32 which uses xxhash i guess.
> I could not find the implementation of the hash functions.
>
>
> Thanks,
>
> Pragash Vijayaragavan
> Grad Student at Rochester Institute of Technology
> email : pxv3620@rit.edu
> ph : 585 764 4662 <(585)%20764-4662>
>
>
> On Wed, Aug 23, 2017 at 2:28 PM, Dumitrescu, Cristian <
> cristian.dumitrescu@intel.com> wrote:
>
>>
>>
>> > -----Original Message-----
>> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pragash
>> > Vijayaragavan
>> > Sent: Wednesday, August 23, 2017 3:16 PM
>> > To: dev@dpdk.org
>> > Cc: Minseok Kwon <mxkvcs@rit.edu>
>> > Subject: [dpdk-dev] cuckoo hash in dpdk
>> >
>> > Hi,
>> >
>> > I got the chance to look at the cuckoo hash used in dpdk and have a
>> query.
>> >
>> > would using division and modulo operations be slower than bitwise
>> > operations on RTE_HASH_BUCKET_ENTRIES, specially since
>> > RTE_HASH_BUCKET_ENTRIES is a power of 2.
>> > For example, to do a modulo we can do a "AND" operation on
>> > (RTE_HASH_BUCKET_ENTRIES - 1), which might be faster. We did a cuckoo
>> > filter for VPP and doing this gave a slight improvement in speed.
>> > Is there any particular reason its done this way.
>> >
>> > Sorry if i am being wrong in any way, i was just curious.
>> >
>> > Thanks,
>> >
>> > Pragash Vijayaragavan
>> > Grad Student at Rochester Institute of Technology
>> > email : pxv3620@rit.edu
>> > ph : 585 764 4662
>>
>> Bitwise AND typically takes 1 cycle on any CPU, while modulo takes dozens
>> of cycles.
>>
>
>

  reply	other threads:[~2017-08-23 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 14:15 Pragash Vijayaragavan
2017-08-23 18:28 ` Dumitrescu, Cristian
2017-08-23 20:20   ` Pragash Vijayaragavan
2017-08-23 20:39     ` Pragash Vijayaragavan [this message]
2017-08-24 14:53 ` Andriy Berestovskyy
2017-08-24 18:54   ` Pragash Vijayaragavan
2017-08-25  9:00     ` Andriy Berestovskyy

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=CANp7S21RjYw22wuBjVsGy3qfCnbnjuggE-EMRZQGxW5Kcr5W6Q@mail.gmail.com \
    --to=pxv3620@rit.edu \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=mxkvcs@rit.edu \
    /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).