Re: speed tests
| From: | Andi Gutmans | Date: | Thu, 08 Apr 1999 07:09:14 +0000 |
| Subject: | Re: speed tests | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8@lists.php.net to get a copy of this message | ||
Hey,
When running in debug mode the memory allocator does quite a bit more work.
Especially when freeing memory it checks the freed memory pointer to make
sure it hasn't been overrun and it also does a memset() on the memory
before being freed. I think this probably slows Zend down quite a bit (but
I'll check exactly how much soon). For people who have performance
problems, the Zend optimizer would speed things up probably between 50%-100%.
Andi
At 23:15 07/04/99 -0400, Rasmus Lerdorf wrote:
>Zeev and Andi, how much debug is in the current code, and what sort of
>effect does the compiler bring? Just testing the looping speed with this
>simple script in php3, php4 and perl5:
>
> $i=0;
> while($i<500000) {
> $b=sin($i++);
> }
>
>The test script is identical for PHP and Perl here and I am on a Solaris
>2.6 box.
>
>php3:
> run 1: 29.07u 0.02s 0:29.95 97.1%
> run 2: 29.98u 0.01s 0:30.34 98.8%
> run 3: 29.74u 0.04s 0:30.29 98.3%
>
>php4:
> run 1: 8.82u 0.03s 0:08.97 98.6%
> run 2: 8.83u 0.01s 0:08.84 100.0%
> run 3: 8.82u 0.02s 0:08.84 100.0%
>
>Perl5:
> run 1: 2.59u 0.02s 0:02.61 100.0%
> run 2: 2.53u 0.01s 0:02.54 100.0%
> run 3: 2.55u 0.02s 0:02.57 100.0%
>
>A big loop like this is going right at Perl's strong point and it is good
>to see that we are now in the same ballpark as opposed to an order of
>magnitude slower with php3 or two orders slowed in php2.
>
>-Rasmus
>
>
---
Andi Gutmans <andi@zend.com>
ICQ: 1568297
PGP: finger andi@vipe.technion.ac.il