Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Unity with iOS target (and probably other platforms) ReportEvent with parameters forces Boxing Allocations #30

Open
HitCache opened this issue Aug 16, 2020 · 1 comment

Comments

@HitCache
Copy link

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!

@HitCache HitCache changed the title Unity iOS (and probably other platforms) ReportEvent with parameters forces Boxing Allocations Unity with iOS target (and probably other platforms) ReportEvent with parameters forces Boxing Allocations Aug 16, 2020
@NesterovichAlexey
Copy link
Contributor

Hi @HitCache
Thank you for the offer. We will add this feature in the next release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants