5

In Drupal, you have a base-theme, and maybe a sub-theme. That sub-theme can also have another sub-theme.

Will Drupal be slower when using 3 themes, where each of them is a sub-theme of the previous one, or doesn't this affect the performance?

8

TL;DR Have as many sub-themes as you want, it's not a problem.

Longer answer All types of inheritance, theming or otherwise, will have a performance penalty, and really all logic that you perform will have that effect; However

  1. With proper caching enabled, only the very first request that uses the sub-sub-theme, is actually going to notice a difference. After that you will have aggregated css/js files from all three (or more) involved themes, and all of this becomes a non-issue until you clear the cache, after which you will again need to aggregate the files once.
  2. With a pretty big generalization, the performance cost is roughly going to be linearly proportional to the number of changes you make. So if you don't make a lot of changes, you won't see a big effect.

Generally speaking, I suggest you approach the problem the other way around. Organize your theme/solve your problem in a way that is efficient for you as a human. Then worry about how to make it efficient for a machine only when necessary.

Since your site isn't written in assembly, your entire site is a huge performance problem, but in the vast majority of cases, a cpu performing literally trillions of calculations in a second makes that a non-issue.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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