Reputation: 2275
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;
}
Upvotes: 6
Views: 1664
Reputation: 150108
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/
Upvotes: 12