How heavy is accessing local scripts?

In the update function of some of my scripts, I have to access scripts on the local gameobject, like something like this:

pa = gameObject.GetComponent("PlayerAttack") cast PlayerAttack
pa.currentStamina -= 25

How heavy is that function to carry out?

Its normally better to avoid using string comparison:

pa = gameObject.GetComponent<PlayerAttack>()

GetComponent is very little hit. You shouldn’t even notice it.

FindObject(s)OfType on the other hand is a big hit and should be used sparingly

Where a function has a large CPU hit, its generally noted in the Unity docs for that function.