Please sign in to comment.
Override ReadByte in PacketReader.
Turns out, the normal BinaryReader was calling NetworkStream.ReadByte, which didn't override ReadByte. As such, every single call to ReadByte would wastefully allocate a 1 element byte array, which ended up being responsible for a significant portion of allocations when running server for extended periods of time.
- Loading branch information...