How to optimize traffic on nettcp binding ? One data object takes 300-1000 bytes in memory. I need transfer near 1 000 000 objects. So i can create more than 1 Gb traffic. Can length of field name influent on serialized object size ( i.e. xml serializer use names in xml elements ) ? And i expect that binary serializer used by default ? Can gzip compression enabled be effective on 1Gb size , total time pack + network transfer + unpack ? May be in this case more effective way create custom serializer ?
By default net.tcp binding will use Microsoft binary XML encoding, which is dependent on the length of XML tags you use, but list them only once. So if you pass all 1000000 objects in one WCF message, then all tags will appear only once.
But what is more important WCF uses buffered mode by default. Which means that you will have all your objects in memory (1 Gb), then WCF will serialize them into something - let's assume this is another 1 Gb. If you use reliable sessions then one more copy of message will reside in memory until confirmation from receiving side is received.
So, not only traffic is important, but also local memory footprint will be significant.