You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into an issue where creating new coroutines is allocating 2 megs of garbage, when a new Processor() is created - easy to see by attaching the Unity CPU profiler.
Any suggestions?
The text was updated successfully, but these errors were encountered:
It's caused by the ValueStack and ExecutionStack FastStack values in Processor.cs -- this is because it is a fixed width stack with a default size of 131072 elements. You can (generally) safely reduce the total number of elements which helps reduce the garbage, but setting these stacks to use pooling is what ultimately you want to do.
If you follow CoroutineState (the enum) and look for where "Dead" is assigned, that's where you recycle the elements back into the pool.
Thank you for posting about this, that's awesome to know. I had moved away from using Moonsharp because of this issue but honestly didn't spend any time looking into it. Good to know it's now a valid option again!
Hi,
Ran into an issue where creating new coroutines is allocating 2 megs of garbage, when a new Processor() is created - easy to see by attaching the Unity CPU profiler.
Any suggestions?
The text was updated successfully, but these errors were encountered: