Templating engines, like Smarty and Twig, almost always provide a system for caching compiled templates in a binary file containing an intermediate code called bytecode.
This often considerably reduces CPU usage, especially when an intermediate code cache is added to the templating engine’s cache system.
To enable caching in Smarty:
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->caching = 1;
$smarty->display('index.tpl');
?>