netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Mack <daniel@zonque.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 1/2] bpf: add a longest prefix match trie map implementation
Date: Wed, 18 Jan 2017 15:30:14 +0100	[thread overview]
Message-ID: <CANq1E4TY1BZfa1da1DB6=M==+JJUuATxT5iCJAAn2_Bi=yuiJw@mail.gmail.com> (raw)
In-Reply-To: <587A581A.6060304@fb.com>

Hi

On Sat, Jan 14, 2017 at 5:55 PM, Alexei Starovoitov <ast@fb.com> wrote:
> Another alternative is to extend samples/bpf/map_perf_test
> It has perf tests for most map types today (including lru)
> and trie would be natural addition there.
> I would prefer this latter option.

I hooked into gettid() and installed a simple kprobe bpf program that
searches for an entry in an lpm trie. The bpf program does either 0,
1, 8, or 32 lookups in a row (always the same element). The trie has
size 0, 1, or 8192. The data is below. The results vary by roughly 5%
on every run.

A single gettid() syscall with an empty bpf program takes roughly
6.5us on my system. Lookups in empty tries take ~1.8us on first try,
~0.9us on retries. Lookups in tries with 8192 entries take ~7.1us (on
the first _and_ any subsequent try).

https://gist.github.com/dvdhrm/4c90e61a1c39746d5c55ab9e0e29315e

Thanks
David


Trie-size: 0
#Lookups: 0
    0:lpm_perf kmalloc 9,230,321 events per sec
    -> 6.5us / syscall

Trie-size: 1
#Lookups: 1
    0:lpm_perf kmalloc 7,224,508 events per sec
    -> 8.3us / syscall

Trie-size: 1
#Lookups: 8
    0:lpm_perf kmalloc 4,152,740 events per sec
    -> 14.4us / syscall

Trie-size: 1
#Lookups: 32
    0:lpm_perf kmalloc 1,713,415 events per sec
    -> 35.0us / syscall

Trie-size: 8192
#Lookups: 1
    0:lpm_perf kmalloc 4,369,138 events per sec
    -> 13.7us / syscall

Trie-size: 8192
#Lookups: 8
    0:lpm_perf kmalloc 943,849 events per sec
    -> 63.6us / syscall

Trie-size: 8192
#Lookups: 32
    0:lpm_perf kmalloc 271,737 events per sec
    -> 220.8us / syscall

  reply	other threads:[~2017-01-18 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-14 12:17 [PATCH v3 0/2] bpf: add longest prefix match map Daniel Mack
2017-01-14 12:17 ` [PATCH v3 1/2] bpf: add a longest prefix match trie map implementation Daniel Mack
2017-01-14 16:55   ` Alexei Starovoitov
2017-01-18 14:30     ` David Herrmann [this message]
2017-01-18 22:29       ` Alexei Starovoitov
2017-01-14 12:17 ` [PATCH v3 2/2] bpf: Add tests for the lpm trie map Daniel Mack

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='CANq1E4TY1BZfa1da1DB6=M==+JJUuATxT5iCJAAn2_Bi=yuiJw@mail.gmail.com' \
    --to=dh.herrmann@gmail.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=daniel@zonque.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).