Skip to content

[FR] Make Firebase.Analytics.Parameter instances reusable. #548

Open
@IoannisFMG

Description

@IoannisFMG

Feature proposal

  • Firebase Component: Analytics

Right now if you want to send an event at some point in your game, you have to instantiate the Parameter class once per parameter.
The only way you can create a Parameter is via its constructor. There are no getters/setters and its fields are marked private (rightfully so) thus making it immutable once created.
Some events might require a considerable amount of parameters to be sent over to the servers. For example, a single ad_revenue event requires 8 parameters. Thus 8 allocations, plus any more needed to gather the data (if applicable).

Allocations are harmful when it comes to code performance and they it's wise if they are minimized. If Parameter class instances were reusable, the overhead of sending an event could be minimal, improving performance both in CPU and RAM (allocations/garbage collection).

I'd like to know if there is a way to do this right now. There seems to be none as far as I know.
If there is none, is there any way we can have this in a future update of the sdk?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions