We have a big trie in our server-side service which has something like tens of millions of nodes. Whole trie takes about 4 gigs of RAM. Until now we used only the basic binary .NET serialization for storing the trie in a file and reconstructing it back in memory. But it's way too slow... What are the better serialization algorithms in our case, some kind of direct mmap
-like trick would be great but .NET doesn't permit custom memory allocators. The aim is to minimize saving and especially loading the trie from the file (filesize is not our concern).
Notice: We absolutely can't use relational databases for that because of the latencies.
Update: Well, we've found this similar question Persisting a trie to a file - C. C community seems better suited for this kind of questions ;) => Accepting protobuf.net solution.
The accepted "fastest serializer" for .net is ProtoBuf.net by a long way the fastest and smallest serializer. http://damienbod.wordpress.com/2014/01/09/comparing-protobuf-json-bson-xml-with-net-for-file-streams/