parent.parent.parent or FindObjectWithTag?

I’m wondering which one is faster, and possibly if anyone knows at what point which one would become slower.

The object my component is on that I want to get is tagged already so it is possible to get it through a tag, but in my head parent.parent.parent.getComponent would be faster, but I’m not sure. Even then the possibility of GetComponentInParent is still there.

Does anyone know definitively which one is faster?

My guess is the same as yours that it would be quicker to go through the hierarchy and then GetComponent<>().

My other thought is that if you are worried about the efficiency it’s probably because you are doing this often. In that case, it would probably help if you can cache the result so you have it next time.

Accessing a variable will almost always be quicker than using a findobject, as such the parent.parent.parent would probably be quicker, but having a script or transform reference would be best