Re: cvs: php4 /sapi/thttpd thttpd.c

From: Date: Thu, 03 May 2001 09:29:56 +0000
Subject: Re: cvs: php4 /sapi/thttpd thttpd.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5495@lists.php.net to get a copy of this message
At 11:23 AM 5/3/2001 +0200, Sascha Schumann wrote:
On Thu, 3 May 2001, Andi Gutmans wrote: Send me the script :) And what is the average length of that returned string?
    the average length of an IP?
You are capable of giving me IPv6 bullshit.
    The results were obtained from a FreeBSD 4.2 machine.
#include <string.h> #define CA "195.123.123.123" main() {
    char buf[512];
    int i = 10000000;
    while (i-- > 0) {
#if 0
        strlcpy(buf, CA, sizeof(buf));
#else
        memcpy(buf, CA, strlen(CA)+1);
#endif
    }
}
Well on my super-duper Redhat system the memcpy() is slower :) strlcpy():
1.640u 0.000s 0:01.65 99.3%     0+0k 0+0io 71pf+0w
memcpy():
2.150u 0.000s 0:02.15 100.0%    0+0k 0+0io 72pf+0w
I guess it depends on the machine. Anyway, I don't really care. Keep it this way and don't bother answering this Email. Andi

« previous php.cvs (#5495) next »