Smarty is very slow sometimes
We use Smarty 开发者_高级运维and time to time it really takes a lot of time for it to render a template. Normally it works fine, but sometimes (like 1 random pageview out of 1 000) it takes about 5 seconds to render a template. We don't use smarty functions or plugins, just simple variables. What might be wrong, where to look? Templates are already compiled and they don't change before the 'slowdown'.
Maybe not exactly what you're looking for, but still an answer:
If you're only working with variables and maybe simple loops and control structures, I'd recommend using another PHP-based template system. After all, PHP was designed to be a template language.
This approach has multiple positive sides:
- You don't have to learn yet another syntax.
- You lose the extra overhead of adding yet another layer on top of PHP, which in large parts duplicates what PHP can already do.
精彩评论