We currently use Silverlight 4 with WCF services and try to read large arrays of users objects from service. In our code it takes about 0.5 (and less) seconds to generate 700 objects, arranged by hierarchy (a lot of loops).
And it takes about 4-5 seconds for Silverlight/WCF to communicate that data - on localhost.
I've measured timings in my code / service call, used Fiddler to see data (5MBs!), and when I tried to pass a simplified object with plain attributes (instead of nested lists, etc), it took much less amount of data and was very quick - like, a second.
I've read many articles on the subject - there's no simple way, the best I could find is to return byte[] from WCF method (and have types in the separate assembly), or highly manual serializers (like protobuf) that require to write custom attributes, etc.
OK I tried those. protobuf-net is extremely hard (adding numbers to 200 existing classes isn't fun), and v2 is not here yet, and binaryMessageEncoding reduced data load from 5.5MB to 4.5MB, not too much.
But, I can't believe, is there any out-of-the-box WCF/Silverlight solution to stream large amounts of data? Isn't it supposed to be a nice modern technology for enterprise solutions?
How do I tell Silverlight/WCF to stream my data faster and smaller, rather than 5MBs in 5 seconds? Can I just say in config: "use small and fast serializer"?