GameObject.Find Efficiency

:slight_smile: Hello Forums!

I am currently trying to find out the efficiency of searching through active objects with GameObject.Find.

I have seen many saying that it’s not efficient. But how exactly does this in-built function works?

Does this function work by bruteforce iteration (e.g. A-Z) finding or through a more efficient way, perhaps indexing?

Any helpful soul care to tell me how the GameObject.Find functions as a search algorithm.

Else, what’s in-built in Unity3D that functions as an efficient search algorithm, any suggestion? Thanks!

Research Dolphin.

I’d like to believe it’s a Dictionary/Hashtable lookup (i.e., O(1) performance), but I honestly couldn’t tell you. Why don’t you try creating a test scene and find out how many Find() method calls you can invoke per second?