[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140524.230335.310083059499297121.davem@davemloft.net>
Date: Sat, 24 May 2014 23:03:35 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: crquan@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] dev-alloc-name-by-check-name-existence.patch
From: crquan <crquan@...il.com>
Date: Sat, 24 May 2014 19:58:12 -0700
> On Sat, May 24, 2014 at 2:57 PM, David Miller <davem@...emloft.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists