performance tweak : assign $this->function() to variable during loop