[SizeMap]Question Of Optimization

Lately I’ve been paying more and more attention to project optimization, in some ways I’ve even become paranoid… :sweat_smile: :sweat_smile: :sweat_smile:
I would like to clarify a question about size maps.
The screenshot shows the size map of the widget:

It shows that almost 90% of its size is character. Do I understand correctly that it doesn’t affect anything, since the character is loaded from the beginning of the game?

Thank you for your help!

if you were to load the widget itself it would pull in the character with it.

For example, this widget – menu, since the menu calls a character that is already created, accordingly I won’t have another character created and the Cast within the widget to the character is essentially “free”, right?

every time you cast you pull in the tested object causing a reference in memory.

If the widget is never used without the casted character then ok. But casting can get costly in other cases.

The reference viewer will show you how far the rabbit hole goes.
It the character references other objects then your menu will pull in the character and anything casted down the line in any further reference.

it can spiral out of control rather fast.
Just try increasing the search depth :wink:

1 Like

I understand that all references are pulled. I just need to understand that if I make a cast in a widget to a character, it doesn’t allocate new memory, it accesses existing memory. :face_in_clouds:

Edit: extended the answer

Yes.
It passes around a pointer and does not copy the actor itself. (so it’s the memory address).
All of the references that point to the specific instance of the characters point towards the same place in memory.

Thanks for the reply!!! To be honest, the more I asked, the more I realized what nonsense I was talking about. But as they say, it’s better to measure seven times and cut once. So thank you for spending your time on me.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.