Re: Calling performance geeks

From: Date: Mon, 13 Mar 2006 09:34:31 +0000
Subject: Re: Calling performance geeks
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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

Thread (34 messages)

« previous php.internals (#22366) next »