Re: CVS update: php3/functions
| From: | Zeev Suraski | Date: | Sun, 27 Dec 1998 23:17:55 +0000 |
| Subject: | Re: CVS update: php3/functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3077@lists.php.net to get a copy of this message | ||
At 09:03 27/12/98 +0100, Sascha Schumann wrote:
>On Sun, 27 Dec 1998, Rasmus Lerdorf wrote:
>
>> > > How much, can you provide some figures or benchmarks?
>> >
>> > I just ran a short benchmark (regal.c) here which showed that at 200000
>> > iterations we save about one third of user time. Attached is a short
graph
>> > which shows the results of two tests with and without the cache.
>>
>> It should be noted that this improvement is only seen when the same
>> regular expression is applied repeatedly. An application with a bunch of
>> different regex calls is not going to speed up.
>
>>From the log:
>
>revision 1.89
>date: 1998/12/25 20:09:47; author: sas; state: Exp; lines: +46 -17
>speed up regexes by introducing a simple cache which is
>effective in the simplest case - using always the same regex
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.
Zeev
--
Zeev Suraski <zeev@zend.com>
For a PGP public key, finger bourbon@netvision.net.il
--
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