Blueprint compare enum

Hello, guys!
I have a question regarding Equal(enum) node.
I am a java programmer and I know that 0 == index is faster than index == 0. Does this apply to the blueprint node as well?


I think, faster way would be byte compare

First selected on top (screen shot). Probably with blueprint is not so much difference, if you need optimized game like this, you should code in C++.

Anyway, this is not very important optimization (no loop) and in game much more important parts, you can lost more frames with bad mesh, code, material etc.

I use mostly 3rd solution, switch on Enum.

I am not comparing on Tick event. I just wondered if it mattered and if there’s any difference. Thank you for your response!

I’m not sure which way is better nor I can’t think about it now so much, but to understand how it works maybe this can help you:

Most of simple looking functions, macros etc in engines are checking loops like this for example. Switch checking every item in array. You can check - here is difference in loop length 0 == index is faster than index == 0 - I’m not sure. This screen is not “exploded” unreal engine macro, just my visualization how I think it works, based on my experience with other macros or engine functions.