Reputation: 6617
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 high.
I am asking for ideas and principles, not code samples.
Thanks much.
Upvotes: 1
Views: 473
Reputation:
Serialization combined with deflation techniques already suggested is highly efficient and reliable.
Upvotes: 0
Reputation: 7203
if you are stuck with a certain communication protocol, perhaps chuncking can be considered.
Upvotes: 0
Reputation: 1075
just using compression. gzip or deflate stream. string compression ratio is very good.
Upvotes: 1
Reputation: 1062790
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.
Upvotes: 8