Re: cvs: php4 /sapi/thttpd thttpd.c
| From: | Andi Gutmans | 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?You are capable of giving me IPv6 bullshit.the average length of an IP?
Well on my super-duper Redhat system the memcpy() is slower :) strlcpy():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 0strlcpy(buf, CA, sizeof(buf));#elsememcpy(buf, CA, strlen(CA)+1);#endif}}
1.640u 0.000s 0:01.65 99.3% 0+0k 0+0io 71pf+0wmemcpy():
2.150u 0.000s 0:02.15 100.0% 0+0k 0+0io 72pf+0wI guess it depends on the machine. Anyway, I don't really care. Keep it this way and don't bother answering this Email. Andi