Forums / Developer / Php code against template language

Php code against template language

Author Message

Jean-Yves Zinsou

Thursday 26 February 2009 1:29:26 am

Hi to all,
Can someone explain why heavy computing is done faster when making a custom template operator that does the computing in php than when using template language?
The template language is compiled and stored as php as well too so why is it slower ?
I have seen many topics saying that heavy computing tasks should be done with custom operators....

Thanks to any one that takes a little time to answer this question.

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Damien Pobel

Thursday 26 February 2009 1:55:00 am

Hi,

The template compiler doesn't understand what you try to do, it simply applies general rules so the generated code is far from being optimized and the generated code is ugly (see files in var/something/cache/template/compiled).
If you write your own code you will probably try to make it as simple as possible which is often faster.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Jean-Yves Zinsou

Thursday 26 February 2009 2:21:01 am

Thanks , i will take a look at the compiled template code, just to know...

Greedings from an another eZpublish developper in Montpellier ;-)

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr