Web Connection
Support for gzip compression in memory (not file-based)
Gravatar is a globally recognized avatar based on your email address. Support for gzip compression in memory (not file-based)
  Rick Steinwand
  All
  May 24, 2019 @ 09:18am

Hi,

Has anyone managed to use gzip compression/decompression in memory? By default gzip is file-based and I would think we could achieve a nice performance boost by eliminating hits to the file system.

I think this is the best resource I found so far: https://stackoverflow.com/questions/1838699/how-can-i-decompress-a-gzip-stream-with-zlib

Thanks!

Gravatar is a globally recognized avatar based on your email address. re: Support for gzip compression in memory (not file-based)
  Rick Strahl
  Rick Steinwand
  May 24, 2019 @ 12:57pm

It's built in:

For files you can read them into strings or blobs first, then compress...

Honestly though - I don't think all of that will save you much in terms of perf. If you have a fast SSD disk the file overhead for 16 megs or less that you can do in memory isn't going to give you a significant perf boost.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Support for gzip compression in memory (not file-based)
  Rick Steinwand
  Rick Strahl
  May 28, 2019 @ 10:51am

Hi Rick,

Thanks for the quick reply and links.

Sorry, but those functions use the temp folder for compression/uncompression.

This function uses temporary files in the Temp folder to unzip the Zip data.

We have ~40 virtual machines using terabytes of storage. Although a portion of it is SSD, we can't count on that. Traffic between servers can easily be larger than 16 mb and more than 6,000 hits per hour during peak times, so every little bit helps.

© 1996-2019