I'm interested in the performance of templating languages in PHP. I've been watching node.js tutorials and am really impressed by the use of JADE (http://jade-lang.com).

I see that JADE can be used in PHP https://github.com/everzet/jade.php and am wonderring about how it works in terms of performance.

I gather that when running for Node or Ruby the HAML or JADE is compiled when the server is started, but since (I gather) PHP loads at request-time there may be performance implications when using a templating language in PHP (then again, maybe the templates are compiled and stored in the cache).

Has anyone seen or done benchmarks of how PHP performs when using HAML, JADE, (other template languages that I don't know about) versus writing the full HTML ? What other considerations should I be aware of? (Assuming an MVC style framework)

有帮助吗?

解决方案

I just implemented Jade.php for one of my Zend Framework projects.

They do cache the parsed jade files as php files, and just include them at runtime. That's what the Zend Framework does with the phtml files, i.e.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top