On Sunday 30 September 2007 04:10:07 Nicholas Clark wrote: > On Sun, Sep 30, 2007 at 12:15:30AM -0700, [EMAIL PROTECTED] wrote: > > Log: > > [src] Optimized Parrot_byte_index(), which was surprisingly expensive. > > It's a little bit tricky because C strings can't have embedded NULL > > characters, so the naive use of the standard library's index() doesn't > > always work. However, it's a good place to start as it tends to run much > > faster than the inchworm code here.
> Would memchr() be of help here? Maybe, depending on how portable it is. man 3 memchr here says that it conforms to SVr4, 4.3BSD, and C99. The latter concerns me slightly. My other concern would be that the cost of calling a function in this loop is more expensive than inchworming and comparing characters. I'm not sure where the one is significantly cheaper than the other (but that's what profiling is for). -- c