Performance or best practice

Hi , i want to know what is better for performance (Internal computer Instructions)

I know on Java language is better check preconditions that catch errors , is here better less nodes or same that JAVA?

eee20afd5881e4ba761672339339aae1db81cb5a.jpeg

up , up , up

It’s not about optimisation, it’s more about segmentation faults. Prechecks are required if your execution flow may come across unexpected behaviour when the input is not what you expected.

As for the above: your “Cast to Protaganista” will take a null value, but will fail. So your check is absolutely useless and is better saved for after “Other Actor” has been cast, checking for “Cast Failed” or not. In this case your second image makes far more sense than the first one and since you only want to proceed if the cast was successful then it doesn’t need to be changed.

Also: Don’t preoptimise. Write your code to be readable and for it to work, optimise later. Preoptimisation will lead you down a horrible road…one which is largely handled by the compiler itself (In C++ and in Blueprints I imagine).

Thanks for your reply =)