Download

Questions Regarding Blueprint Optimization

Hi. Something’s been bugging me for a while and I just want to know something, because the uncertainty is killing me.

Lets say that I have a blueprint that is setting the relative rotation or transform of a particular “static mesh component” every tick. Would it be wise do a branch and check to see if the static mesh rotation (or transform) has changed since the last tick, or is it perfectly acceptable to let the blueprint continually update the rotation (or transform) every tick forever, even if it hasn’t changed at all? Is there a performance penalty for constantly updating relative rotation (or transform), or is it exactly the same as simply checking the rotation of the current tick against the rotation of the last tick?

Picture to illustrate:

https://dl.dropboxusercontent.com/u/1997866/forums-sites/2016/12/2016-12-22_Which_BP_is_better.png

I was going to ask something else too but I can’t remember.

Thanks!
-Neil (CaptainMigraine)

This is premature optimization and you shouldn’t worry about things like this now.
But to answer your question:

A Transform is just data. In the first case you compare 3 structs (Location,Rotation,Scale), if they’re not equal you override this data.
So you always compare.
In the second case you simply override the data.
So the second case is faster.

Interesting. So, the act of actually “updating” the relative transform of a static mesh component has no performance impact? I think I’m curious about the performance impact of the mesh transform being updated.

Transform is just data, this has nothing to do with the mesh being rendered.