Skip to content

Add C# codegen for Clear message to reuse message objects in a pool #18782

Open
@batesj

Description

@batesj

What language does this apply to?
C# codegen.

Describe the problem you are trying to solve.
Using protobufs in Unity can cause excessive garbage collection overhead because of all the new class instances created while parsing a proto into a message instance.

Describe the solution you'd like
I would like to be able to reuse a pool of message instances repeatedly for parsing protos.

Describe alternatives you've considered
I could not find examples, but perhaps there is a way to do it with reflection? Of course, if that's expensive then it is replacing garbage with CPU overhead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c#enhancementinactiveDenotes the issue/PR has not seen activity in the last 90 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions