open-project-1 icon indicating copy to clipboard operation
open-project-1 copied to clipboard

Multiple event regist and unregist generate too much GC

Open huleli opened this issue 4 years ago • 1 comments

Short description The scriptable object event system is a smart way and I like the style. But I get one performant issue. Take InputReader as an example, In my case, I use about 40 gameobjects.

Each gameobject use a simple regist and unregist in OnEnable and OnDisable.

and enable gameobject and disable gameobject.

Then I noticed a lot GCAlloc about 60kb of 11 calls in profiler.

Is there a way to get that GCAlloc as less as possible? In my case, there may be about 30 or more gameobjects enable or disable in one frame.

huleli avatar Jun 29 '21 09:06 huleli

But I get one performant issue.

Is this a performance issue on Chop Chop, or on your game? Different games might require different architecture. We created this system for Chop Chop, and it does the job. If the performance is low on Chop Chop, we'll look into fixing it, but otherwise it is something that you'd need to figure out on your own, sorry!

ciro-unity avatar Aug 23 '21 10:08 ciro-unity