Re: [PATCH V2 2/2] module: Fix performance regression on modules with large symbol tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 14 Nov 2011 08:48:52 +0000, "Jan Beulich" <JBeulich@xxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux