Re: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php
| From: | Hannes Magnusson | Date: | Tue, 28 Jul 2009 14:53:38 +0000 |
| Subject: | Re: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php | ||
| References: | 1 2 3 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-4542@lists.php.net to get a copy of this message | ||
On Tue, Jul 28, 2009 at 15:28, Moacir de
Oliveira<moacirdeoliveira.eng@gmail.com> wrote:
>> > $this->currentchunk = end($this->chunks);
>> > + $dbhtml = $this->getPIHandler("dbhtml");
>>
>> Rather then retrieving the object on every single chunk (that'll be
>> over 8000 method calls...), how about making that variable static?
>> Something like:
>>
>> static $dbhtml = null;
>> if (!$dbhtml) {
>> $dbhtml = $this->getPIHandler("dbhtml");
>> }
>>
>
> I was thinking in use the pi handlers as singletons. what do you think?
Unless you keep a reference to the singleton in that method its still
gonna be an extra method call on every chunk...
>> We really need to watch the overhead in the methods that are called
>> few thousands times...
>>
>
> could you suggest some benchmark?
You could try asking Alexander Hjalmarsson, he is a gsoc student
working on "Better Benchmarks"..
He could probably help you come up with benchmarks :)
-Hannes