[FR] Make `Firebase.Analytics.Parameter` instances reusable.
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!
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
👍
Yes. It's a bummer to instantiate so many parameters and sometimes so frequently.