lkml.org 
[lkml]   [2011]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V2 2/2] module: Fix performance regression on modules with large symbol tables
Date
On Mon, 14 Nov 2011 08:48:52 +0000, "Jan Beulich" <JBeulich@suse.com> wrote:
> > + name = &mod->strtab[src->st_name];
> > + if (unlikely(!test_bit(src->st_name, info->strmap))) {
> > + /* Symbol name has already been copied; find it. */
> > + char *dup;
> > +
> > + for (dup = mod->core_strtab; strcmp(dup, name); dup++)
> > + BUG_ON(dup > s);
>
> Aren't you concerned that this again will be rather slow? It would be
> pretty easy to accelerate by comparing only with the tail of each string
> (as nothing else can possibly match), moving from string to string instead
> of from character to character.

Kevin's central thesis is that this is actually really unusual.

I'm not sure how much faster a tail search would be in practice. We're
still scanning the string. Perhaps a "dup[0] == name[0] &&" would
optimize it almost as well, if gcc doesn't already?

Kevin, you're probably in an optimal position to get numbers on this?

Thanks,
Rusty.


\
 
 \ /
  Last update: 2011-11-16 03:37    [W:0.071 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site