Search code examples
rubyziprubyzip

Rubyzip vs native OS compression


I am wondering what would be the performance difference when zipping data using rubyzip as compared to using native os libraries for performing the compression. I am fetching data to be compressed from a URL and then using the ZipOutputStream to create the zip file. In case of native OS utilities I am thinking of using the zip tool. Would be nice to hear some pros and cons for both the approaches.


Solution

  • It turns out that there is not much of a difference in terms of the time taken for the operation or the CPU usage. But there was a significant difference when it came to memory usage. With rubyzip the process ended up using a lot more memory compared to when using the zip util. In our use case memory usage was a significant concern and hence we ended up using the zip util.