When I draw AnimationCurve Property with odin, A lot of gc is generated, It's 100mb or more

Issue #665 wontfix
HalfLobsterMan created an issue

When I draw AnimationCurve Property with odin, A lot of gc is generated, It's 100mb or more, use [DrawWithUnity] is the same, but unity default draw is ok

I just create a AnimationCurve field

Comments (6)

  1. Tor Esa Vestergaard

    This is a bit of an unfortunate, but unavoidable fact of life. Unity’s animation curve drawing has access to native internal structures. Odin, meanwhile, must use the public animation curve API that Unity provides in order to do its job, and this API allocates a lot of extra data. Thus, if you have an enormous curve, a lot of stuff will be allocated, since Unity’s API is so wildly inefficient and does not give us direct access to the inspected data, but passes us complete new copies of everything whenever we ask for it. As such, we can’t really fix this issue, I’m afraid. Or at least, we cannot fix it without introducing a lot of bugs and limitations to Odin's drawing and handling of animation curves.

  2. Tor Esa Vestergaard

    I suggest that, for the types that contain such massive curves, you disable Odin drawing entirely in the preferences > editor types window.

  3. Log in to comment