Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43981 invoked by uid 1010); 13 Mar 2006 09:34:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43964 invoked from network); 13 Mar 2006 09:34:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2006 09:34:37 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:58067] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 0C/50-55982-DAC35144 for ; Mon, 13 Mar 2006 04:34:37 -0500 Received: from [192.168.200.106] (c-24-6-5-134.hsd1.ca.comcast.net [24.6.5.134]) (authenticated bits=0) by colo.lerdorf.com (8.13.5/8.13.5/Debian-3) with ESMTP id k2D9YVCN014765; Mon, 13 Mar 2006 01:34:33 -0800 Message-ID: <44153CA7.3060307@lerdorf.com> Date: Mon, 13 Mar 2006 01:34:31 -0800 User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: Marcus Boerger CC: internals References: <4414F63F.5030406@lerdorf.com> <1845610431.20060313102228@marcus-boerger.de> In-Reply-To: <1845610431.20060313102228@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Calling performance geeks From: rasmus@lerdorf.com (Rasmus Lerdorf) Marcus Boerger wrote: > Hello Rasmus, > > not a thing for 5.1 or 4.4 but in 5.2 we could change to a case > insensitive comparison function. That would allow us to change nearly > all of strcasecmp to memcmp. And in may cases it means one less > allocation. And it also means a lot of less code. The casinsensitive > comparision is pretty easy because we can use a 256 byte translation > table that can be provided as a static const table. On a X86 systems > we could also provide that in assembler. That would give us the > possibility to use the XLAT instruction that would otherwise not be > used (maybe newer optimizing compiler know about it though). > > Maybe it is worse trying to bring it in and checking how much slower > we are getting with it. If the numbers look promising we could go for > the change then. > > A word on HEAD/Unicode. If we use a case insensitivity semantics where > only the normal ascii characters are lowercased we can use the same > table based approach. > > Anyway from looking at the output the best optimization was brought up by > you already. Using jit for the ap_* stuff. Well, that doesn't come anywhere near the radar here actually. The 300k+ strcasecmp calls are coming from the qsort in Apache, not from PHP. Even then, 300k strcasecmp calls is minor here. So I doubt you could even measure the effect of that change. -Rasmus