Casting nodes (float to int, into to float)

After working on a blueprint for an extended amount of time I find that my graphs get a little cluttered with casting nodes,
e.g. int (teal) wires being converted to float(lime) wires and back.

I usually go back over the graph to resolve any conversions that aren’t really necessary.
I was wondering if excessive type cast conversions impact performance of a cooked exe or whether the compiler is clever and optimises anything that is reduncant.

E.g.

If you had:
FLOAT → INT → FLOAT → INT

will the compiler see the unnecessary reduncancy and factor down to:

FLOAT → INT

or does the compiler make no asumptions and cooks exactly what is wired?

Hey -

To answer your question it would be the second. The compiler is going to preform exactly the tasks you tell it to. So if you wire in multiple conversions then it will run through each conversion explicitly.

Cheers

Why would you do FLOAT → INT → FLOAT → INT in first place? Also blueprint is not compiled to exe, but to VM code in pak file if im not mistaken

Thanks .

It wouldn’t be done intentionally, it was just a hypothetical example in order to ask what the compilier will see.

In reality, I sometimes have reduncant/unnecessary auto-cast nodes in/out of a function graph because I later rewired something and the cast was no longer necessary. Sometimes I miss the reduncancy and was wondering how much of a performance impact casts have in general.