I am looking for fastest serialization method tiles in 2D world. Lets say the world is big and because computer can't handle that much blocks loaded at the same time, so I splitted the world to chunks. BinaryFormatter
seems to be slow. Is there any faster method, how to serialize the chunk object?
WChunk object structure
public class WChunk
{
public int ChunkX;
public int ChunkY;
public SortedDictionary<WPoint, WTile> Tiles;
}
WTile object structure
public class WTile
{
WPoint Location;
int Data;
}
Object serialization is the process of converting state of an object into byte stream. This byte stream can further be stored in any file-like object such as a disk file or memory stream. It can also be transmitted via sockets etc. Deserialization is the process of reconstructing the object from the byte stream.
Serialization refers to the process of converting a data object (e.g., Python objects, Tensorflow models) into a format that allows us to store or transmit the data and then recreate the object when needed using the reverse process of deserialization.
The fastest option I'm aware of is Protocol Buffers.
There is a performance comparison here (thanks @Andrei)
http://theburningmonk.com/2011/08/performance-test-binaryformatter-vs-protobuf-net/
.NET implementations
http://code.google.com/p/protobuf-net/
http://code.google.com/p/protobuf-csharp-port/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With