NAME
Gzip::Faster - gzip and gunzip, without the fuss
SYNOPSIS
use Gzip::Faster;
DESCRIPTION
This module compresses data to the gzip format and decompresses it from the format.
FUNCTIONS
gzip
my $zipped = gzip ($stuff);
Compress $stuff
.
gunzip
my $stuff = gunzip ($zipped);
Uncompress $zipped
. This will cause a fatal error if $zipped
is not compressed.
PERFORMANCE
This section compares the performance of Gzip::Faster with IO::Compress::Gzip and IO::Uncompress::Gunzip. Here is a comparison of a round-trip:
Rate IO::Compress::Gzip Gzip::Faster
IO::Compress::Gzip 1199/s -- -91%
Gzip::Faster 12800/s 968% --
Here is a comparison of gzip (compression) only:
Rate IO::Compress::Gzip Gzip::Faster
IO::Compress::Gzip 2355/s -- -87%
Gzip::Faster 17582/s 647% --
Here is a comparison of gunzip (decompression) only:
Rate IO::Uncompress::Gunzip Gzip::Faster
IO::Uncompress::Gunzip 2739/s -- -96%
Gzip::Faster 67368/s 2360% --
The test file is in "examples/benchmark.pl" in the distribution.
There is also a module called Compress::Raw::Zlib which offers access to zlib itself. It may offer improved performance, however I have not figured out what it does yet. Its documented way of making a gzip compressed object actually returns a deflate-format buffer without a gzip header.
BUGS
The module includes functionality to round-trip various Perl flags. I applied this to preserving Perl's "utf8" flag. However, the mechanism I used trips a browser bug in the Firefox web browser where it produces a content encoding error message. Thus this functionality is switched off.
COPYRIGHT AND LICENCE
This software may be used, modified, distributed under the same licence as Perl itself.