Researched this a long time ago here is the post:
https://www.casualdistractiongames.c…tallactorswith
tldr - Internally, on each class, UE4 maintains a hashmap of all instances of it.
afaik GetAllActorsFromClass should be orders of magnitude faster than GetAllActorsWithInterface and GetAllActorsWithTag, since it utilizes that class specific HashMap. (Deep class hierarchies still require traversing)
Disclaimer: I haven’t looked into this for a long while - so things may have changed. It’s worth digging in to the source if you are curious as there are several interesting things to discover…If you do, please be sure to post any additional findings…