tech-userlevel archive

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

Re: [PATCH] implementing a faster algorithm for strpbrk(3) in libc

On Tue, Sep 23, 2008 at 06:09:27PM +0200, Alan Barrett wrote:
> On Tue, 23 Sep 2008, Ilya Dogolazky wrote:
> > The new algorithm does not use any array initialisation.
> > Instead of that the only integer variable "index" is initialized.
> > It is not using any bitwise operations and shifts as well.
> This is clever, but it's not obvious that it will be faster than the
> existing code (since it will have more conditional branches), and it's
> even less obvious that it would be faster than something that simply
> changes the existing bit array to a byte array.
> Do you have benchmarks?

That run in a cache constrained environment.
ie one where the on-stack arrays used are not already in the data cache,
and where adding them is likely to exclude other 'hot' data.


David Laight:

Home | Main Index | Thread Index | Old Index