Simple comparison between the compression software gzip and xz

Source: Internet
Author: User

Simple comparison between the compression software gzip and xz

Due to the need to handle disk alarms, logs are compressed. In this compression, gzip and xz software are used respectively to compress the text. The compression results are very surprising.

The objects in the delimiter format are smaller. First, let's briefly introduce gzip and xz:

Gzip: GZIP was first created by Jean-loup Gailly and Mark Adler for File compression in the un ix system. We often use files suffixed with .gz in linux, which are in GZIP format. Nowadays, it has become a widely used data compression format on the Internet, or a file format.

Xz: xz is a compressed file format. The target file is 30% smaller than the gzipcompressed file (.gz or · tgz) and 15% smaller than the bz2.

Due to the limited disk space, we use the-9 parameter for compression. The highest compression ratio of each compression is used. The fame and fortune are as follows:

Gzip: gzip-9-c source_filename> source_filename.gz

Xz: xz-9-c source_filename> source_filename.xz

Shows the final test result:

It can be seen that the source file iqas-2015-07-28 size is 35G, after gzip compression, the final file is 4.6G size, the compression ratio is about, this is a good result, but let's take a look at the size of the file compressed by xz is 401 MB, which is an order of magnitude smaller than that of gzip. The compression ratio is close to 1: 90, this saves a lot of space for text storage. However, it should be noted that the 9-level compression of xz is very time-consuming and memory-consuming. If the time and memory are sufficient, you can consider this method. If the time and memory are tight, we recommend that you use gzip.

This article permanently updates the link address:

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.