Friday, December 19, 2008

Adding string compression to the ThreeSharp wrapper

I wanted to store XML blobs on AWS.

However, these are notoriously bloated - so I thought I'd zip them first (yes, I know there are other compression formats available!)

Note - this optimisation was more for the benefit of network latency rather than for reducing required storage.

To do this I built this class (I added it to the existing namespace - you might want to use the code somewhere else?) - the two methods of importance are:
  • AddStringObjectWithCompression
  • GetStringObjectWithDecompression
On my xml data this took a typical stored data size down from about 233628 bytes to 30012 bytes which will save me bandwidth costs, storage costs and will save me both network delays and help me avoid dropouts too - but admittedly it might cost me some compute power on the encode and decode.


SNIP - Code moved to new post - - blogger garbled the first one (I must move to a better platform!)

No comments:

Post a Comment