Hey there. I have several questions recently about optimization that I’ve had a hard time finding the answers to. All questions are in reference to UE5 blueprints. Thanks in advance for any insight to any of the below.
-
How do “Switch” nodes work performance wise? Does a switch have to iterate through every option and attempt to match to the input? Is it effectively a series of nested boolean statements, or does it function differently somehow?
-
How does the “Contains” (string) node function in comparison to the switch node? Assuming you have a list of words and are trying to check if the list contains any one of them, would that function any differently than a switch node? For the switch, does the variable type matter to performance, such switching on an enum?
-
What overhead do nodes add? For instance, if you had two identically functioning blueprints, but one had an extra 100 nodes compared to the other, what performance difference would they be? Would 1k nodes make a difference? 10k?
-
What is the overhead to variables, such as a boolean? Besides the binary behind it (and I suppose the name of the variable), is there any other usage metric that comes variables in general? Would 100 variables have a different impact? 1k?
-
Is there any overhead to using a lot of local variables? Do they get created/destroyed every time a blueprint (that uses them) is loaded? Does this process have any impact?
-
Is it realistically worthwhile to re-use variables when you can performance wise? Or is the gain so negligible that it’s not really worth putting effort into?
-
This is more asking opinions, but when is it worthwhile to prioritize or worry about optimization when everything is running fine? Assuming optimization would just be removing a bunch of redundant nodes and connections, is it ever really necessary to do so, or would those gains be minimal?
Thank you again for any answers or insight you can provide.