GetComponent In Update

I have a standalone class called “ShipAttrib” whereby I store all the typical variables like HP and Speed of all my player and enemy objects in the game and I paste that class script in all of them. I go around accessing those variables through GetComponent, and since they’re live variables I usually call GetComponent in Update() for quite a number of concurrent game objects simultaneously. I read that that is bad practice. If so, is there a way to get the real time variables without using static variables? Also is there any difference between these 2 codes:

 public TextMeshProUGUI speeddisplay;
    GameObject Player;
    ShipAttrib speed;
    

    void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player");
        speed = Player.GetComponent<ShipAttrib>();

    }

    void Update()
    {
        speeddisplay.text = "Speed: " + speed.Speed;
    }

2nd:

public TextMeshProUGUI speeddisplay;
        GameObject Player;
        
        void Start()
        {
            Player = GameObject.FindGameObjectWithTag("Player");
            
        }
    
        void Update()
        {
            speeddisplay.text = "Speed: " + Player.GetComponent<ShipAttrib>().Speed;
        }
    }

Hello.

Its little difference, but 1st way consumes less than 2nd way. But the difference is sooo small for a single scriopt/object. But if you have thusands/hundreds of objects doing the same, is better to use 1st way.

Bye!!