metrica-plugin-unity
metrica-plugin-unity copied to clipboard
Unity with iOS target (and probably other platforms) ReportEvent with parameters forces Boxing Allocations
Hi @NesterovichAlexey
To use ReportEvent
with parameters forces a Dictionary<string, object>
which means there will always be boxing allocations to convert to object.
Since it passes the dictionary to ymm_reportEventWithParameters (message, JsonStringFromDictionary (parameters))
internally could we have another non-allocating method exposed please? one that accepts a json string that we created?
for example something like:
public override void ReportEvent (string message, string parametersJsonString)
{
ymm_reportEventWithParameters (message, parametersJsonString);
}
then we could generate our own JSON string without alloc via another library or whatever.
If you like this idea but are too busy to implement please let me know and I will submit pull request!
Hi @HitCache Thank you for the offer. We will add this feature in the next release.