Traditional templates such as SimpleTemplate and ITX use macro substitution, which becomes incredibly expensive on complex templates (loops). Use Smarty instead.