Nicholas Clark nick at
Thu May 10 23:42:45 BST 2007

On Thu, May 10, 2007 at 11:22:41PM +0100, Andy Armstrong wrote:
> On 10 May 2007, at 23:09, Nicholas Clark wrote:
> >er, why not strlen() and then a pointer addition?
> >That's not the first time I've seen that idiom, but I can't see how an
> >implementation of strchr() is going to be tighter than one of strlen()
> I can think of at least one implementation where strchr() is  
> definitely slower than strlen().
> Remember Norcroft C Nick? :)

Yes. But I wasn't aware of that one.

I was aware that some functions were not the fastest assembler implementation
that was possible, and that did actually seem strange, given that it was
quite fun (and only a few hours once you knew the tricks) to write optimal
versions of each.

Nicholas Clark

More information about the mailing list