This project has moved and is read-only. For the latest updates, please go here.

Most efficient way to Serialize?

Jul 5, 2010 at 7:46 AM


Which is the most efficient way (quickest) to be serializing a collection of items of the same type? Is it using JsonConvert.SerializeObject or is it to use the JsonSerializer manually? Would appreciate some code example.



Jul 6, 2010 at 11:25 AM

Take a look at the source code and judge for yourself.

Hint: One calls the other.

Jul 6, 2010 at 12:26 PM

So it's only a "helper". Sorry for not looking at the source-code. I guess that different Settings and Formatting doesn't affect the process to much, just the outcome....

By the way... StringWriter implements IDisposable. Maybee wrapping it in a using statement (event if Dispose is empty)?