In my unity application I have some event handling for events received by the machine through the osc protocol while scenes are going
I'm noticing a bit of ui stuttering and after profiling I found that there's a lot of garbage collection activity in one of my event handler functions (see the image)
The function in question is below. All i'm doing is deserializing the event string into an object and then passing the object along. It's not great that i'm creating a new object every single time but i'm not sure how to rewrite this so that i only have a fixed number of object instances that i'm repopulating.
Any help would be appreciated!