A simple comparison of the compression software gzip and XZ

Source: Internet
Author: User

At night due to the need to deal with disk alarm, the log compression, in this compression used gzip and XZ software to compress the text, the results of compression is very surprising.

The reason for the curiosity about XZ is that when you download the kernel source code, you can often see the. xz format package, and its size is smaller than the. GZ and. bz2 format files. Let's start with a brief introduction to Gzip and XZ:

  1. Gzip:gzip was originally created by Jean-loup Gailly and Mark Adler for file compression of Unⅸ systems. We often use files with the. gz suffix in Linux, which are in gzip format. Nowadays it has become a very popular data compression format, or a file format, used on the Internet. More detailed information about gzip can be found in the Baidu Encyclopedia.
  2. XZ:XZ is a compressed file format that uses Lzma SDK compression and the target file is 30% smaller than the gzip compressed file (. gz or tgz), which is 15% smaller than bz2. A more detailed introduction can be found in Wikipedia.

Here due to the limited disk space, we use the 9 parameter to compress, using the highest compression ratio per compression, using the fame as follows:

  1. Gzip:gzip-9-C source_filename > source_filename.gz
  2. Xz:xz-9-C source_filename > Source_filename.xz

The final test results are as follows:

You can see the source file iqas-2015-07-28 size of 35G, after gzip compression, the final file is 4.6G size, compression ratio of about 1:8, this is a good result, but then look at the XZ compressed after the size of the file is 401M, This is an order of magnitude smaller than gzip, and the compression ratio is close to 1:90, which saves a lot of space for text storage. However, it is important to note that the XZ 9-level compression is time-consuming and memory-intensive, and if time and memory are sufficient, you can consider this method, and if the time and memory are tight, then we recommend using gzip.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A simple comparison of the compression software gzip and XZ

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.