[FrameworkBundle] Improved TemplateNameParser performance