I\'m using Newtonsoft\'s Json.NET 7.0.0.0 to serialize classes to JSON from C#:
class Foo { public string X; public List Y = new List&l
If you can modify your classes, you could add Shrink method and set null for all empty collections. It requires to change the class but it has better performance. Just another option for you.