We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Performance difference between Template Partials & Variables?

Development and Programming

From EE Slack's avatar
From EE Slack
185 posts
2 years ago
From EE Slack's avatar From EE Slack

I’m curious how much of a performance difference there is between using Template Partials vs Template Variables?

       
From EE Slack's avatar
From EE Slack
185 posts
2 years ago
From EE Slack's avatar From EE Slack

Off the top of my head, I’d say minimal… Most of the performance issues we see are due to how things are looped, embeded with loops things along those lines in templates.

       
Hop Studios's avatar
Hop Studios
481 posts
2 years ago
Hop Studios's avatar Hop Studios

Partials get very minimal parsing of their own. Variables get basically none.

So in one way, they both have very little effect. But Partials become part of the main template, so a complex partial can definitely cause a lot of processing to happen.

This is because partials are parsed at the BEGINNING of the parsing process, so if they have code, that code can affect performance. Meanwhile, variables get parsed at the very end of the parsing process, so they can’t have active code, which means they really can’t affect performance much at all.

       
wilkinsonwilfrid's avatar
wilkinsonwilfrid
2 posts
2 years ago
wilkinsonwilfrid's avatar wilkinsonwilfrid

I am extremely grateful to you. Due to the fact that you supplied the facts, I was able to have a better understanding of what was going on pertaining to me. basketball stars

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.