Skip to content

Multiple event regist and unregist generate too much GC #456

Open

Description

@huleli

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.

Activity

  1. ciro-unity commented on Aug 23, 2021

    @ciro-unity
    Contributor

    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!

  2. added
    ?Action required: missing information, question to answer, or CLA not signed
    and removed
    enhancementNew feature or request
    bug (minor)The game could potentially ship with this bug
    on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ?Action required: missing information, question to answer, or CLA not signed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions