httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: strncasecmp
Date Tue, 24 Nov 2015 00:47:03 GMT
FWIW, a new version using clock_gettime() instead of gettimeofday().
Same/Comparable results for optimized vs string.h's (the former wins
but with -Os).

On Tue, Nov 24, 2015 at 1:43 AM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
> On Tue, Nov 24, 2015 at 1:24 AM, Mikhail T. <mi+thun@aldan.algebra.com> wrote:
>>
>> Is there really a gain in inc- and decrementing this way? Would not it be
>> easier to read with the explicit increments -- and, incidentally, no
>> decrements at all?
>
> No measured difference in my tests, I guess it depends on likelyhood
> to fail/succeed early in the string or not.
>
>>>
>>> We don't care about the whole process time and other counters.
>>
>> That's certainly true. But, then, why bother with building time-counter into
>> the test at all -- instead of simply relying on time(1)?
>
> That's the purpose of newtest.c (vs Christophe's test.c): try both...
>
>>
>> But something is still not right -- the result (for either of the methods)
>> can depend on the number of iterations (!!):
>
> That's expected (or at least no cared about in this test case).
> We simply want res to not be optimized out, so print it before
> leaving, without any particular relevance for its value (string.h and
> optimized versions should return the same res with the same args,
> ascii strings only, though).

Mime
View raw message