I did my own template system once with {username} kind of variables replaced in html template by regex replace function and it was not huge resource spending. Basically it would be ok for most regular size pages, IMHO.
During optimization of my template system I use page about 1mg in size and...