Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have c# console application and I want to save the content of dictionaries in a file or database.so I wanted to ask:
which is faster(serialize/deserialize)using serialization libraries like(fastjson) or (select/insert)from/into database?
Posted

I guess (a local) database should be faster. However nothing prevents you comparing the actual performances by measuring them (with data compatible with your scenario).
 
Share this answer
 
Comments
Member 12127665 14-Dec-15 14:54pm    
thank you. i'll try.
I see you already asked Mehdi Gholam a question in the comment section of his article on fastJSON here; why not ask him about performance/memory-use also.

Although, I think that performance/memory-use will vary depending on the various Types you are serializing, the database you use, etc.

As Mehdi states in his article, fastJSON will handle Dictionaries; you might ask him if Types that contain instances of the same Type have any problems being serialized ... since you are using a tree-structure.

You might also evaluate WCF (DataContract, DataMember) for serializing; I have serialized tree-structures with WCF. I first serialized with WCF to a memory stream; then used Gzip to compress it, and saved the compressed code to disk. The resulting Gzip file was almost always less than half the size compared to saving the WCF serialized code as XML.
 
Share this answer
 
Comments
Member 12127665 14-Dec-15 14:53pm    
thanks alot for your replies.
I don't asked Mehdi Gholam because last time he didn't reply to my question!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900