Here's some webgrind output:
  Ocramius_Zend_View_PHPTAL->__construct    O     1     872     *5213*
Calls    Count    Total Call Cost
  Zend_Loader_Autoloader::autoload @ 0     1     1338     O
  PHPTAL->__construct @ 91     1     787     O
  Zend_View_Abstract->__construct @ 105     1     633     O

require_once::/home/betainf/trunk/sites/it/informavacanze/library/PHPTAL/PHPTAL/PreFilter.php
@ 89     1     545     O
  Ocramius_Zend_View_PHPTAL->_loadConfig @ 92     1     225     O
  Ocramius_Zend_View_PHPTAL->_setTemplatesDir @ 101     1     185     O
  Ocramius_Zend_View_PHPTAL->_setCompiledDir @ 94     1     128     O
  Ocramius_Zend_View_PHPTAL_Translator->__construct @ 104     1     118
O
  PHPTAL->set @ 100     1     102     O

require_once::/home/betainf/trunk/sites/it/informavacanze/library/PHPTAL/PHPTAL.php
@ 88     1     93     O
  Ocramius_Zend_View_PHPTAL->setEncoding @ 95     1     63     O
  Ocramius_Zend_View_PHPTAL->setStripComments @ 96     1     48     O
  PHPTAL->setTranslator @ 104     1     40     O
  PHPTAL->setPhpCodeExtension @ 99     1     22     O
  Ocramius_Zend_View_PHPTAL->setMinify @ 97     1     5     O
  Ocramius_Zend_View_PHPTAL->setNormalize @ 98     1     5     O

require_once::/home/betainf/trunk/sites/it/informavacanze/library/PHPTAL/PHPTAL/PreFilter/Normalize.php
@ 90     1     4     O
Called From    Count    Total Call Cost
  Application_Model_Resource_View_PHPTAL->getView @ 36     1     5218     O

Please tell me if it's OT, I just like Zend_Application resources that much
that I would move to it from any other framework that hasn't them :)

Marco Pivetta
@Ocramius <http://twitter.com/Ocramius>
http://marco-pivetta.com



2010/12/22 Marco Pivetta <ocram...@gmail.com>

> Hmm... Not sure about the performance impact... As I'm using APC anywhere,
> I'm not considering the includes a trouble anymore...
> Anyway, here's an example of how I integrated the view with just a couple
> of lines of code:
> http://pastebin.com/jiFWEfDB
> I'm not noticing more than 10 msecs of time used when creating PHPTAL
> instance this way...
> This when running on Xen VPS, Intel i7-920, limited to 1 core, cap to 90%
> of the cpu clock, 128Mb  of ram dedicated to APC (apc.stat=1)...
>
> Marco Pivetta
> @Ocramius <http://twitter.com/Ocramius>
> http://marco-pivetta.com
>
>
>
> 2010/12/22 Robert Goldsmith <rgoldsm...@names.co.uk>
>
>
>> Hello :)
>>
>> Sorry for not replying to everyone's comments but I'm on holiday for
>> christmas :)
>>
>> Regarding Marco's comment on Zend_Application_Resource_Interface I would
>> guess it is a question of how Ztal is loaded into a Zend Application. We
>> initially used a combination of application resource helper and action
>> helper, as is the 'normal' way used by many
>> other integration projects (for PHPTAL, Smarty etc.) but found the
>> performance hit to be unacceptable. Both helpers make extensive use
>> of introspection and a many-to-many mapping in the autoloader which makes
>> them slow as well as hard to debug and sometimes unpredictable
>> (all problems the ZF guys are aware of and something ZF2 plans to tackle
>> in radical and most likely non-ZF1-compatible ways).
>>
>> Instead, we go for a plugin approach and setup our replacement View object
>> pre-dispatch. This way the View is available before the controller action is
>> triggered but it already has enough information to map a route to a module,
>> controller and action and can, therefore, correctly setup the paths needed
>> to load the correct templates for the module. One known limitation of this
>> is that internal redirects (rather than browser redirects) to a different
>> module are not currently captured and the paths will be incorrect for
>> loading the templates. I have some ideas on this but the gain from this
>> sacrifice is ~ 80ms performance gain which, in my tests, is about 20% of the
>> entire execution time of a 'normal' action in my fully loaded apps (with
>> caching, translation support etc.).
>>
>> Obviously we are working hard to document all of this and certainly in the
>> new year I will do my best to answer any and all questions from everyone :)
>> As a company we are pretty new to the process of releasing an open source
>> project so please be patient ;) As it says in the sparse documentation we
>> have already released we plan to camp out in #ztal on freenode for anyone
>> who has questions. As I'm sure everyone will agree, this mailing list is not
>> the place to really discuss Ztal but I really hope there can be a good
>> relationship between the projects.
>>
>> In case anyone wondered, we are already using Ztal internally on projects
>> and fully intend all future development to include Ztal and PHPTAL. We've
>> been using Ztal in various ways for over a year and already serve tens of
>> thousands of requests a day using the technology (in Italian and English)
>> across our company intranet. Our next step is upgrading some of our customer
>> facing services where, as we roll out the upgrades, we expect hundreds of
>> thousands and then millions of daily page hits.
>>
>> Robert Goldsmith
>>
>> On Sun, 19 Dec 2010 13:31:44 +0100, Marco Pivetta  wrote:
>>
>>
>> Robert, do you have any Zend_Application_Resource_Interface resource in
>> the code-base? Didn't see any (had only 10 mins to look at Ztal till
>> now)...
>> Marco Pivetta
>> @Ocramius [1]
>> http://marco-pivetta.com [2]
>>
>>
>>
>> _______________________________________________
>> PHPTAL mailing list
>> PHPTAL@lists.motion-twin.com
>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>
>
>
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to