Hello everyone, I would like some hints/tips about good optimization practices to maintain a good C++ flow/performance, I’m quite new to C++ but not new to programming in general and this is why I know that there usually are some practices that allows for a better code performance, and since I’m on a quite decent-sized project now, I would like some tips to avoid performance issues in the long run, thank you very much.
Besides that i think the UE4 code base makes it quity easy to write performant code. The available datastructures are good and i to my knowledge there no inefficient datastructures out there. Just pick the right one for your use case. My advise here is to build your own code based on their coding principles. Have a look at code that they implemented for a good idea how to keep it performant. For example: if you need a container class, always start with TArray and only use TMap/TSet when really needed (e.g. really large number of items in a container could make TMap/TSet faster)
If you are going to write multiplayer code another challenge is keeping the data send over the internet to a minimum.
You should try to prevent to many replicated properties and too many RPC calls. If you need to do it, try to do it with the smallest datastructure possible (boolean for example).
Just a note, I have reason to believe that bools actually get serialized as 32 bits, meaning you’d actually be better off just using an int8 or an enum