Re: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php

From: Date: Tue, 28 Jul 2009 13:28:24 +0000
Subject: Re: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/ChunkedXHTML.php
References: 1 2  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4541@lists.php.net to get a copy of this message
> > > @@ -110,6 +113,7 @@ > > if ($value) { > > > $this->registerElementMap(static::getDefaultElementMap()); > > $this->registerTextMap(static::getDefaultTextMap()); > > + $this->registerPIHandlers($this->pihandlers); > > Shouldn't they use similar registration procses as the element/textmaps? > That way we could overwrite/merge them in inherited formats.. > true, I'll fix it. > > > } > > break; > > case Render::INIT: > > @@ -291,12 +295,16 @@ > > return false; > > } > > if (array_pop($this->isChunk)) { > > - array_pop($this->chunks); > > + $lastchunk = array_pop($this->chunks); > > $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? > > > + if ($dbhtml->getAttribute("filename")) { > > + $this->nfo[$lastchunk]["filename"] = > $dbhtml->getAttribute("filename"); > > And rather then making the exact same method call twice in a row, > please do something like: > $filename = $dbhtml->getAttribute("filename"); > if ($filename) { > $this->nfo[$lastchunk]["filename"] = $filename; > } > > oki > We really need to watch the overhead in the methods that are called > few thousands times... > > could you suggest some benchmark?

« previous php.doc.cvs (#4541) next »