This is the way to bypass RegExp parsing on template load. Instead of parsing the original template on every request, we keep its internal representation (a serialized array, essentially) and load it instead.
Think about template compilation in Smarty. Only Sigma does not compile templates to PHP code.
No data caching is taking place. If you want to do this, consider using some of the PEAR's cache packages.
No. Cached version is considered valid until the source template changes.
Yes, just delete all the files in the cache dir.
Yes. The answer is based on personal experience.
If you are going to perform some benchmarks, then use some real-world complex templates, not artificial ones. The performance gain will be greater with bigger and more complex (dozens of blocks) ones.
$tpl =& new HTML_Template_Sigma('./templates', './templates/prepared');
// go on
For each distinct template file in
./templates loaded with either loadTemplatefile(), addBlockfile(), replaceBlockfile() or <!-- INCLUDE --> a prepared version will be generated in