开发者

What is an efficient way to send large data over the wire?

I have a list of strings List<string>. Actually is a list of file paths. And I need to send it to a webservice. The list can contain huge count of items (1 000 - 10 000).

What would be the most efficient way to accomplish this? considering that the message payload will be quite h开发者_StackOverflowigh.

I am asking for ideas and principles, not code samples.

Thanks much.


For paths - firstly (or rather: lastly) gzip or deflate it. If large numbers of things are going to have common roots, nest that data perhaps?

i.e. so

/foo/bar/blap/a/b
/foo/bar/blap/c/d

becomes

/foo/bar/blap
 /a/b
 /c/d

Beyond that - the payload is going to far exceed any protocol overheads etc, so use whichever protocols etc make life simple for you.


just using compression. gzip or deflate stream. string compression ratio is very good.


if you are stuck with a certain communication protocol, perhaps chuncking can be considered.


Serialization combined with deflation techniques already suggested is highly efficient and reliable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜