netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: crquan@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] dev-alloc-name-by-check-name-existence.patch
Date: Sat, 24 May 2014 23:03:35 -0400 (EDT)	[thread overview]
Message-ID: <20140524.230335.310083059499297121.davem@davemloft.net> (raw)
In-Reply-To: <CAH5vBdKc09Oseb2P=K9X2xqzy4UYHtKW5UCS+9NV_EyYEKJxDA@mail.gmail.com>

From: crquan <crquan@gmail.com>
Date: Sat, 24 May 2014 19:58:12 -0700

> On Sat, May 24, 2014 at 2:57 PM, David Miller <davem@davemloft.net> wrote:
>> The cost is iterating creating the string over and over again
>> and then doing the hash lookup each time.
> 
> The original code calls sscanf / snprintf / strncmp for each existing intf,
> new code is not creating the string, it calls snprintf only, and it won't call
> more than original times of snprintf, right? I think here it depends on
> hash lookup performance,

The bitmap scan is one call, and fast forwards the search to the first open
index.

So it's a bitmap scan plus _ONE_ string creation and hash lookup in the most
common case, even with thousands upon thousands of devices.

I'm not applying your patch, it's a regression.

If you disagree with me, show performance numbers supporting your argument.

      reply	other threads:[~2014-05-25  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-24 21:46 [PATCH] dev-alloc-name-by-check-name-existence.patch Cheng Renquan
2014-05-24 21:57 ` David Miller
2014-05-25  2:58   ` crquan
2014-05-25  3:03     ` David Miller [this message]

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=20140524.230335.310083059499297121.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=crquan@gmail.com \
    --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).