Re: svn commit: r1715876 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Ruediger Pluem
On 11/23/2015 05:46 PM, yla...@apache.org wrote: > Author: ylavic > Date: Mon Nov 23 16:46:01 2015 > New Revision: 1715876 > > URL: http://svn.apache.org/viewvc?rev=1715876=rev > Log: > Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive). > > Modified: >

Re: svn commit: r1715876 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Marion & Christophe JAILLET
Hi, 1 typo below. Moreover, this kind of patch is a good candidate for backport as it introduces many small differences between 2.4 and trunk. Without a backport, backporting future patches may become a nightmare. I would find useful to split it into several pieces. The first one should

Re: svn commit: r1715876 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Yann Ylavic
On Mon, Nov 23, 2015 at 8:37 PM, Ruediger Pluem wrote: > > On 11/23/2015 05:46 PM, yla...@apache.org wrote: >> >> -case 'p': >> -case 'P': { >> -/* handle most common quickest cases... */ >> -if (!strcmp(token, "private"))

Re: svn commit: r1715876 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Yann Ylavic
On Mon, Nov 23, 2015 at 9:00 PM, Marion & Christophe JAILLET wrote: > Hi, > > 1 typo below. Fixed in r1715938, thanks. > > Moreover, this kind of patch is a good candidate for backport as it > introduces many small differences between 2.4 and trunk. > Without a

Re: strncasecmp

2015-11-23 Thread Christophe JAILLET
Hi Jim, Do you have done some benchmark and have results to share? I tried to do some but the benefit of the optimized version is not that clear, at least on my system: gcc 5.2.1 Linux linux 4.2.0-18-generic #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
Hi Christophe, On Mon, Nov 23, 2015 at 9:12 PM, Christophe JAILLET wrote: > > I tried to do some but the benefit of the optimized version is not that > clear, at least on my system: >gcc 5.2.1 >Linux linux 4.2.0-18-generic #22-Ubuntu SMP Fri Nov 6 18:25:50

Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c

2015-11-23 Thread Jim Jagielski
++1 > On Nov 22, 2015, at 10:33 AM, William A Rowe Jr wrote: > > On Sat, Nov 21, 2015 at 5:10 PM, Eric Covener wrote: > On Sat, Nov 21, 2015 at 5:47 PM, William A Rowe Jr > wrote: > > I suggest this is wrong, and that the

Re: svn commit: r1715789 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Jim Jagielski
> On Nov 23, 2015, at 7:33 AM, yla...@apache.org wrote: > > Author: ylavic > Date: Mon Nov 23 12:33:09 2015 > New Revision: 1715789 > > URL: http://svn.apache.org/viewvc?rev=1715789=rev > Log: > Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive). > > > Modified:

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
I modified your test program a bit (to measure time from it, see attached), tried with -O{2,3,s}, and except -Os I always have better results with the "optimized" version, eg: $ ./a-O3.out 0 15000 xcxcxcxcxcxcxcxcxcxcwwaa xcxcxcxcxcxcxcxcxcxcwwaa 0

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
Please note that the changes in ap_str[n]casecmp(), ie: ++ps1; ++ps2; was a first try/change which (obviously) did nothing. You may ignore it. On Mon, Nov 23, 2015 at 11:43 PM, Yann Ylavic wrote: > with attachment... > > On Mon, Nov 23, 2015 at 11:42 PM,

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
with attachment... On Mon, Nov 23, 2015 at 11:42 PM, Yann Ylavic wrote: > I modified your test program a bit (to measure time from it, see > attached), tried with -O{2,3,s}, and except -Os I always have better > results with the "optimized" version, eg: > > $ ./a-O3.out 0

Re: svn commit: r1715876 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread William A Rowe Jr
On Nov 23, 2015 14:12, "Yann Ylavic" wrote: > > On Mon, Nov 23, 2015 at 9:00 PM, Marion & Christophe JAILLET > wrote: > > > > Moreover, this kind of patch is a good candidate for backport as it > > introduces many small differences between 2.4

Re: strncasecmp

2015-11-23 Thread Mikhail T.
On 23.11.2015 23:14, William A Rowe Jr wrote: > L1 cache and other direct effects of cpu internal optimization. Just what I was thinking. Attached is the same program with one more pair of functions added (and an easy way to add more "candidates" to the main-driver). I changed the FOR-loop define

Re: strncasecmp

2015-11-23 Thread William A Rowe Jr
On Nov 23, 2015 21:12, "Mikhail T." wrote: > > On 23.11.2015 19:43, Yann Ylavic wrote: >> >> No measured difference in my tests, I guess it depends on likelyhood to fail/succeed early in the string or not. > > ? I don't see, where it wins anything -- but I do see, where

[Dev] GSoC Intro and Contribution to Apache

2015-11-23 Thread Vithuląñ Ḿṿ
Hi, I'm Vithulan, Undergraduate of Computer Science and Engineering in University of Moratuwa, Sri lanka. I have quite experience in Java, JavaScript, Android and Open Source, Currently doing my internship in a open source middle-ware company. I'm a potential GSoC candidate, and would love to

Re: strncasecmp

2015-11-23 Thread Mikhail T.
On 23.11.2015 19:05, Yann Ylavic wrote: > Here is the correct (new) test, along with the diff wrt the original > (Christophe's) test.c. BTW, if the program measures its own time, should it not use getrusage() instead of gettimeofday()? -mi

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
On Tue, Nov 24, 2015 at 1:07 AM, Mikhail T. wrote: > > BTW, if the program measures its own time, should it not use getrusage() > instead of gettimeofday()? Well, it measures the time spent in the relevant code, with a monotonic clock, that should be fair enough. We

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
On Mon, Nov 23, 2015 at 11:42 PM, Yann Ylavic wrote: > except -Os I always have better > results with the "optimized" version To reach better performances with -Os, we could possibly use: int ap_strcasecmp(const char *s1, const char *s2) { const unsigned char *ps1 =

Re: strncasecmp

2015-11-23 Thread Mikhail T.
On 23.11.2015 17:43, Yann Ylavic wrote: > with attachment... There is a mistake somewhere in the optimized version: ./o 1 1 aa1a 0 Optimized (nb=1, len=0) time = 0.611311 : res = 0 The result should not be zero. Indeed, the string.h version is correct: ./o 0

Re: strncasecmp

2015-11-23 Thread Mikhail T.
On 23.11.2015 19:05, Yann Ylavic wrote: > while (ucharmap[*ps1] == ucharmap[*ps2++]) { > if (*ps1++ == '\0') { > return (0); > } > } > return (ucharmap[*ps1] - ucharmap[*--ps2]); Is there really a gain in inc- and decrementing this way? Would not it be

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
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 wrote: > On Tue, Nov 24, 2015 at 1:24 AM, Mikhail T.

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
On Tue, Nov 24, 2015 at 12:46 AM, Mikhail T. wrote: > On 23.11.2015 17:43, Yann Ylavic wrote: > > with attachment... > > There is a mistake somewhere in the optimized version: My bad, I somehow corrupted the original ap_str[n]casecmp() functions. Here is the correct

Re: strncasecmp

2015-11-23 Thread Yann Ylavic
On Tue, Nov 24, 2015 at 1:24 AM, Mikhail T. 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

Re: strncasecmp

2015-11-23 Thread Mikhail T.
On 23.11.2015 19:43, Yann Ylavic wrote: > No measured difference in my tests, I guess it depends on likelyhood to > fail/succeed early in the string or not. ? I don't see, where it wins anything -- but I do see, where it loses a little... > That's expected (or at least no cared about in this test

Re: svn commit: r1715789 - in /httpd/httpd/trunk: modules/cache/ modules/filters/ modules/generators/ modules/http/ modules/http2/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ mo

2015-11-23 Thread Yann Ylavic
On Mon, Nov 23, 2015 at 3:05 PM, Jim Jagielski wrote: > > That's cheating :) Yeah, reverted (r1715869) and re-committed (r1715876) with no functional change. Thanks for catching!

Re: svn commit: r1715859 - /httpd/httpd/trunk/include/httpd.h

2015-11-23 Thread William A Rowe Jr
On Mon, Nov 23, 2015 at 9:58 AM, wrote: > Author: jim > Date: Mon Nov 23 15:58:25 2015 > New Revision: 1715859 > > URL: http://svn.apache.org/viewvc?rev=1715859=rev > Log: > we just worry about "equality" with this implementation... > So it's not a "real" strcasecmp replacement.

Re: strncasecmp

2015-11-23 Thread Marion & Christophe JAILLET
I just made a small application which takes as command line parameters the number of iteration to run, which version of the algorithm to use, the 2 strings to compare and the length to compare (or 0 for the non 'n' versions) Compiled using gcc -O3 test.c Tested using