NaughtyAttributes icon indicating copy to clipboard operation
NaughtyAttributes copied to clipboard

GC allocs for rendering

Open lucasmontec opened this issue 2 years ago • 1 comments

I'm getting around half mb of GC allocs when rendering a component with just a few attributes. The asset also seems to be making assembly reloading sometimes slow, scaling somewhat badly as it grows in numbers. Have you checked performance issues with a very large amount of attributes?

image

lucasmontec avatar Aug 11 '23 17:08 lucasmontec

Its getting worse. I had to abandon the asset for 2 projects in my company. Unfortunately, it's blowing up with allocations (around 7MB per frame) on certain cases. I’ve tracked it down to something with the serialized reference elements using PropertyField with showChildElements=true causing it to blow up. Its something around the PropertyHandler.GetHeight() and the UseReorderabelListControl(). Its calling RuntimeFieldInfo.GetValue() lots of times. There's a string format call that is called a lot and allocs a lot. There's also a runtimeType.ToString allocation around .6MB per frame.

My team member reported over 100mb per frame.

profiler snapshot: https://mega.nz/file/AA13wLbD#u_eao9JWr2eemvLwrORIIUkleapeIDe55eG2x8qQm4k

lucasmontec avatar Sep 26 '23 19:09 lucasmontec