I am using contemplate in most of my sites. But I am wondering how much does contemplate module affect overall performance. Can such flexibility come without significant cost?

Comments

jrglasgow’s picture

Content templates in the default mode stores all the templates in the database, it also stores information about whether or not there is a template for the node type in the database and every time the node is rendered, either the full node or just the teaser contemplate can make several queries to the database.

The way to increase the performance is to not use contemplate and create the templates as part of the theme using the node template overrides.

Drupal scans the theme to see if there are node template overrides when the theme registry is rebuilt. Then the theme system only has one database query to get information about which the node template file to use, and it is doing this already.

This only become a huge problem if you don't have access to write to the file system.

tramsaal’s picture

I'm not sure I understand you correctly.
Basically you are saying not to use Contemplate and rely on standard theming instead? Is it that bad? :-)
I am using Contemplate on sites with complex layouts. To achieve the same thing with standard node templates would require heavy use of php code, cck field templates etc. Should I drop Contemplate even in these cases?

rastarr’s picture

It would be an interesting exercise if Contemplate could spit out the php code to create the customised node template overrides.

picxelplay’s picture

It is helpful to use Contemplate as a development resource. Use it to build the layout of your nodes (or whatever you are theming) then transfer the Contemplate code to your .tpl.php file. Since you have easy access to variables with Contemplate, it makes for fast and easy theming. Then, all is in code, and note the db.