2

My wcf is hosted by IIS and used basicHttpBinding. My common data is datasets, whci I should serialize and transmit to client. I haven't got hundreads of MB, but I want to trnasmit it to client with best perfomance.

As I understand I should use MTOM encoding. Right?

Also want to know about type of transmitting object: DataSet, Byte[], Gzip Stream (by IIS or manually).

I think my scenario is rather common. Want to hear your working fast design.

Andrew Kalashnikov
  • 3,073
  • 5
  • 34
  • 57
  • 1
    Best performance?? **Don't** use DataSets - they have big overhead.... use straight lists of objects instead.... – marc_s Oct 06 '10 at 17:11

1 Answers1

3

IMO the fastest way to do this would be with protobuf-net via a DTO (instead of data-table). Protobuf-net can plug into WCF with just config file changes and had demonstrably the smallest output and fastest processing of any general purpose serializer I know of. I may be biased (I wrote that version) but it is free, so worth a try.

But no data-tables.

And yea, MTOM helps when passing binary (which protobuf is), but not XML (so MTOM with standard DataTable is pointless)

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • (I can supply a recent SO question on comparative WCF serializer performance as supporting evidence if you like) – Marc Gravell Oct 06 '10 at 17:48
  • Marc, thanks a lot. Yeah, can u be so kind give me this link. Also want to ask. if I want pass result of db queries to client I should put result of queries in dtos, and pass to client with (binary protobuf). Ok. But if I haven't got any ORM for get db results to domains and map into dto, and my db query results are just xml string. How should I pass to client this(without object collection)? – Andrew Kalashnikov Oct 07 '10 at 17:45
  • @andrew http://stackoverflow.com/questions/3790728/performance-tests-of-serializations-used-by-wcf-bindings/3793091#3793091 – Marc Gravell Oct 07 '10 at 20:13
  • re the other: if you want the best performance, the client will have to know in advance what it is expecting. In many cases you can share the DTO between client and server – Marc Gravell Oct 07 '10 at 20:16