This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Improve strsep


(replying to https://sourceware.org/ml/libc-alpha/2016-11/msg00856.html to keep things
in the right thread) 

Adhemerval Zanella wrote:

> > -  static const char d[] = "1234567890abcdef";
> > +  static const char d[] = "1234567891abcdef";
>
> I think it worth a comment saying '1' is duplicated to avoid
> have a delimiter in every position.

I'll add a comment. The benchmark at least does do something now - however we
really need to get some traces as unlike memcpy it is hard to even have a gut feeling
about typical use...

> > -    for (size_t hlen = 2 * klen; hlen < 16 * klen; hlen += klen)
> > +    for (size_t hlen = 4 * klen; hlen < 8 * klen; hlen += klen)
> 
> Why change the lengths to test?

Did you try running it? It takes forever and generates a huge amount of useless output.
With my fix it runs much slower as it now does actual work so I needed to reduce the
number of tests.

> OK. Also not related to patch itself, but since it does not apply clean
> I would recommend to list the possible prerequisites for this patch
> if the intention is indeed using on top of any other patch.

It should apply cleanly now in v2, but you can still get merge conflicts when trying
it out of order.

Wilco

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]