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
In addition to what @ObsidianMinor has said, we are also planning a new serialization/deserialization API that can avoid allocations completely (at least in some cases).
The WIP is here (but it's probably going to take a bit until it lands as the change is not trivial) #5888
public byte[] Encode(int id,IMessage msg)
{
using (MemoryStream rawOutput = new MemoryStream())
{
using (CodedOutputStream output = new CodedOutputStream(rawOutput))
{
output.WriteEnum(id);
output.WriteMessage(msg);
output.Flush();
return rawOutput.ToArray();
}
}
}
In Unity, every time this code is encoded, a considerable amount of GC will be generated, which is about 5k per call, or more than 200 k per frame
The text was updated successfully, but these errors were encountered: