VTubeTiny icon indicating copy to clipboard operation
VTubeTiny copied to clipboard

High Heap allocation by GetHashCode

Open HugoVG opened this issue 1 year ago • 0 comments

in almost all RenderEditorGUI there is a memory with the ImGui.PushID($"{GetHashCode()}"); (coming from GetHashCode()) lines, it is allocting a ton on the SOH, sometimes even targeting LOH if it has a lot of smaller components(audio, childeren, text change, multiple textures).

image

image

Original post

Potential fixes:

  • let the component make an guid or random int so that is still identifiable by ImgUi. Gotta experiment a bit more to get something to work.

Another related bug: When renaming an actor or changing something around, the dropdown closes, this can be an issue with GetHashCode since it makes a new hashcode - leading to ImgUi not knowing it should keep that open en rerendering it.

HugoVG avatar Apr 23 '23 20:04 HugoVG