7

I have used about 110 template files (tpl.php) in my theme, will that slow my drupal site?

I mean:

more template files == consume Server performance.

11
  • 2
    Having a lot of files by itself is not necessarily a problem. If you're concerned, try benchmarking your site with a theme that uses the template files and then another theme that does not. Nov 3, 2013 at 15:15
  • From your comment I understand that a lot of template files will not consume Server performance, is that right ?. If I try benchmarking I will not see the difference because Im working in Localhost. so you have any idea
    – slix ikou
    Nov 3, 2013 at 15:40
  • localhost or remote host you need server to run PHP, and most of the bench-marking in world are done in local environment. Benchmark gives results, and those numbers can show you difference.
    – user12947
    Nov 3, 2013 at 17:56
  • Im sorry Jhilke Dai, I dont get it !! is Benchmark software or what, Im sorry Im jsut a Beginner.
    – slix ikou
    Nov 3, 2013 at 18:02
  • 1
    Apache Bench, http-perf are few famous ones. Just Google Server Performance Benchmark Tool you'll see lots of them both free and commercials. Chose what suits your best. I personally like http-perf and Jmeter
    – user12947
    Nov 3, 2013 at 18:32

1 Answer 1

5

Say you override the default page.tpl.php with your own in your theme folder, and compare this to the case of using the default. In both cases, one page.tpl.php is being evaluated during the page render process - either the default template or yours. Even if you do not override the template, Drupal must search the theme folder to check if an override exists. Of course, if you have a lot of complex logic in your override the page will render more slowly, but that is not due to the overriding itself.

Creating custom templates with hook_theme might slow things down, though.

In general, caching will do more to speed up your site since it bypasses page rendering altogether.

2
  • Thanx user24505 for the Answer
    – slix ikou
    Nov 5, 2013 at 18:31
  • If you are replacing a theme function with call to template file, it will certainly slow down (at least relatively) because function calls are faster than file operations.
    – Sivaji
    Nov 6, 2013 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.