0% found this document useful (0 votes)
27 views5 pages

Linuxreport

Uploaded by

khadijakennou04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views5 pages

Linuxreport

Uploaded by

khadijakennou04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Course name : Linux System

Report:comparative the efficiency of


compression tools(bzip2,gzip,xz,zip)
Name:KENNOU KHADIJA
ID:229J85
1-introduction
Compression is a crucial technique for reducing file size, enhancing storage efficiency, and
speeding up file transfers. With the increasing demand for efficient storage and transmission, it is
essential to choose the most suitable compression tool based on specific requirements—whether
minimizing storage size, optimizing processing time, or speeding up decompression. This report
evaluates four commonly used compression tools: bzip2, gzip, xz, and zip.
The tools are assessed on three critical factors: compression ratio (how well the tool reduces file
size), compression time (how quickly the tool compresses the file), and decompression time (how
long it takes to recover the original file). Understanding the trade-offs between these metrics is
crucial to selecting the right tool for specific use cases.

2-Experiment Setup
All tests were conducted in a Kali Linux environment. The evaluation involved a single large test
file designed to simulate a common use case where file size and performance optimization are
critical. The results were collected by applying each compression tool and timing both
compression and decompression operations. Additionally, the compression ratios for each tool
were compared.

3-Overview of Compression Tools


bzip2:
Algorithm: Burrows-Wheeler Transform (BWT) and Huffman coding.
Characteristics: High compression ratio, slower speed.
Best Use: Archiving large datasets.

gzip:
Algorithm: DEFLATE (combining LZ77 and Huffman coding).
Characteristics: Moderate compression ratio, fast speed.
Best Use: General-purpose tasks.

xz:
Algorithm: LZMA2 (Lempel-Ziv-Markov chain algorithm).
Characteristics: Best compression ratio, slow speed.
Best Use: Minimizing file size for archival storage.
Course name : Linux System
zip:
Algorithm: DEFLATE.
Characteristics: Moderate compression ratio, can bundle multiple files.
Best Use: Project backups, document archives.

4-Experimental Procedure

a-Test File

b-bzip2
compression

decompression
Course name : Linux System

c-gzip
compression

decompression

d-xz
compression

decompression
Course name : Linux System

c-gzip
compression

decompression

5-Results

Tool Compression Time Decompression Time origenal size Compressed Size Compression Ratio

bzip2 6.39 3.95 75 1ookb 3:1

gzip 1.72 0.33 75 20kb 2.5:1

xz 11.17 0.16 75 16kb 3.75:1

zip 1.53 5.07 75 32kb 2.34


Course name : Linux System

6-Analysis
Compression Time:
gzip is consistently the fastest in compressing the file, making it ideal for users who prioritize
speed over compression ratio.
xz takes the longest time due to the complexity of the LZMA2 algorithm but compensates with
a much better compression ratio.
bzip2 offers a good balance but is generally slower than gzip while achieving a higher
compression ratio.
Decompression Time:
gzip and zip decompress quickly, providing fast retrieval of the original file which is ideal for
scenarios where frequent access to the compressed data is needed.
xz, though providing an excellent compression ratio, is relatively slower in both compression
and decompression which may not be suitable for scenarios that require rapid data access.
Compression Ratio:
xz consistently outperforms the other tools in terms of compression ratio, making it ideal for
situations where minimizing file size is the priority.
bzip2 also provides a good compression ratio but is slower than xz.
gzip and zip offer more moderate compression ratios, balancing between speed and
efficiency.

7- Conclusion
Each compression tool has unique strengths and weaknesses depending on the requirements:
bzip2: Ideal for tasks where maximizing compression ratio is important but slower speeds are
acceptable.
gzip: The best all-around option providing a fast and reasonably efficient compression
solution for everyday use cases.
xz: Excellent for minimizing file size but at the expense of compression and decompression
speed. Best for tasks that prioritize file size over speed such as archival storage or software
packaging.
zip: Useful for bundling multiple files into a single compressed archive. While not the most
efficient in terms of compression ratio, its versatility makes it a good option for managing
complex file structures.

You might also like