Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DwarvenTrader |
This is a “performance” related question.
Le’ts say I have around 50 instances running around, checking 3 different conditions every frame, will the second code be faster than the first one?
func _process(delta):
if Something_Common and Something_That_Is_Rare and Something_SUPER_rare:
do_something()
func _process(delta):
if Something_SUPER_rare and Something_That_Is_Rare and Something_Common:
do_something()
In other other words, should I ask the engine to check the rarest condition first so he can move on, instead of going all the way every single frame?