GameObject.FindGameObjectsWithTag-low FPS

I use GameObject.FindGameobjectWithTag for finding enemies , but when i have many turrels with this script, fps is very low, i use this function in update(), but i heard that it needs to be in Awake(), but when I fill code in awake() turrels dont work
I actually use Code FindClosestEnemy and write in c#.
Thanks a lot.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class cannon : MonoBehaviour {
	
 Transform target; 

public Transform bullet;
public float attackRange = 30.0f;
public float shootAngleDistance = 10.0f;
public float gundamag = 30;	

	

	
float _time = 5.0f;
double t = 0.3f;
	
float objectdefault_y_position = 21.55736f;	
 
void Awake(){

	
		
}
void Start(){
	
	}


	
void Update(){
	

		
	GameObject closest=null;
		float distance = 5000f;	
		
		
		
		foreach(var enemy in Enemy_test_Scrpt.AllEnemies)
  {
		
		var diff=(enemy.transform.position-transform.position);	
		var curDistance=diff.sqrMagnitude;	
		if(curDistance<distance)
			{
				closest=enemy;
				distance=curDistance;
				
			}
					
  }	
		
	target=closest.transform;			
		
	
		

	
	
	
   var targetPoint = target.position;
   var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up);
   transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 4.0f);

   var forward = transform.TransformDirection(Vector3.forward); 
   var targetDir = target.position - transform.position; 

		
RaycastHit hit;
		

		if(Physics.Raycast(transform.position,transform.forward,out hit,200f)){//стрельба
			Debug.DrawLine( transform.position, target.position, Color.red);
			
			

			Pause ();
				
				
			if(t>=0.5){
			
			if(hit.transform.gameObject.layer!=4){	
				
				hit.transform.gameObject.GetComponent<Enemy_test_Scrpt>().target_health-=gundamag;
					}			
			t=0.3;	
			}
		}
	}
		
void Pause(){
		
if(t<0.5){
t+=Time.deltaTime*(1.0/_time);	
}	
	}
}

Yep don’t go calling FindGameObjectWithTag in Update(). Add the code to Start() and cache the results in a list or an array.

Or add a script to your enemies that stores them in a list that is a static:

  using System.Collections.Generic;

  public class EnemyList : MonoBehaviour 
  {
       public static List<GameObject> AllEnemies = new List<GameObject>();
       void Awake()
       {
            AllEnemies.Add(gameObject);
       }
       void OnDestroy()
       {
            AllEnemies.Remove(gameObject);
       }
  }

Now you can work through your enemies using:

  foreach(var enemy in EnemyList.AllEnemies)
  {
  }