Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benchmarking HAML vs JADE vs HTML in PHP?

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)

like image 262
Alex C Avatar asked May 03 '11 15:05

Alex C


1 Answers

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.

like image 165
Sebastian Hoitz Avatar answered Oct 14 '22 21:10

Sebastian Hoitz