Re: CVS update: php3/functions
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: CVS update: php3/functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3078@lists.php.net to get a copy of this message | ||
> How costly are regex's? If they're extremely costly, we can have a bigger
> cache, implemented as a limited-size hash table implemented in FIFO. A
> lookup would be fairly quick (basically, a hash lookup with the pattern
> being the key) so if regex's are relatively slow (and aren't O(1), which
> they aren't) it would give a noticable performance boost. That table can
> also be persistent (i.e., saved across hits) which would increase
> performance even more.
I think making this table persistent would be the key to speeding things
up. Typically a PHP script will have 2 or 3 different regular expressions
on a page and that page will be hit many times. Cacheing on a per-request
basis probably doesn't buy anybody much, and it would in fact slow things
down because the extra code needed to create the cache without ever
getting a cache hit would come into play. However, as soon as you cache
across requests you are going to see performance improvements.
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net