Oof, that’s loaded question…here’s my two cents
- Avoid GetAllActorsOfClass (it should be removed from the baseline IMO)
- Seriously consider if what you think belongs on tick can be handled better with an event timer or better yet, an event dispatcher.
- Remember that all actors and components tick by default. Disable it on those which never need to (which is a large majority of them in practice)
- Put some thought into your collision setups. If you have collision (Query or Physics) turned on for a given actor, the physics engine is always aware of where they’re at and what they’re doing.
…and certainly don’t do GetAllActorsOfClass on tick!
That is always going to be true as blueprint incurs a bit of overhead due to the translation layer. That said, for a lot of things that overhead will be negligible. It just depends on the use case. As @Astrotronic suggested, stat and stat early. Learn to monitor performance early so you will be aware of when something you introduced breaks performance. Use BP for what it really excels at which is handling of media (visual, audio, etc.) and rapid prototyping. I along with others tend to prototype in BP first then move functionality into C++. Iteration times tend to be much faster in BP by a long shot.
Good luck!