GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Compress::Snappy(3) User Contributed Perl Documentation Compress::Snappy(3)

Compress::Snappy - Perl interface to Google's Snappy (de)compressor

    use Compress::Snappy;

    my $dest = compress($source);
    my $dest = decompress($source);

The "Compress::Snappy" module provides an interface to Google's Snappy (de)compressor.

Snappy does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression. For instance, compared to the fastest mode of zlib, Snappy is an order of magnitude faster for most inputs, but the resulting compressed files are anywhere from 20% to 100% bigger.

    $string = compress($buffer)

Compresses the given buffer and returns the resulting string. The input buffer can be either a scalar or a scalar reference.

    $string = decompress($buffer)

Decompresses the given buffer and returns the resulting string. The input buffer can be either a scalar or a scalar reference.

On error (in case of corrupted data) undef is returned.

This distribution contains a benchmarking script which compares several compression modules available on CPAN. These are the results on a MacBook 2GHz Core 2 Duo (64-bit) with Perl 5.14.2:

    Compressible data (10 KiB) - compression
    ----------------------------------------
    Compress::LZ4::compress     183794/s  1795 MiB/s  1.152%
    Compress::Snappy::compress  122496/s  1196 MiB/s  5.332%
    Compress::LZF::compress      44383/s   433 MiB/s  1.865%
    Compress::Zlib::compress      2765/s    27 MiB/s  1.201%
    Compress::Bzip2::compress      110/s     1 MiB/s  2.070%

    Compressible data (10 KiB) - decompression
    ------------------------------------------
    Compress::LZ4::decompress     546133/s  5333 MiB/s
    Compress::Snappy::decompress  175363/s  1713 MiB/s
    Compress::LZF::decompress     135244/s  1321 MiB/s
    Compress::Bzip2::decompress     6352/s    62 MiB/s
    Compress::Zlib::uncompress      5440/s    53 MiB/s

    Uncompressible data (10 KiB) - compression
    ------------------------------------------
    Compress::LZ4::compress     763738/s  7458 MiB/s  107.463%
    Compress::Snappy::compress  552269/s  5393 MiB/s  100.000%
    Compress::LZF::compress     532919/s  5204 MiB/s  101.493%
    Compress::Bzip2::compress    15424/s   151 MiB/s  185.075%
    Compress::Zlib::compress      4325/s    42 MiB/s  105.970%

    Uncompressible data (10 KiB) - decompression
    --------------------------------------------
    Compress::LZF::decompress     2583577/s  25230 MiB/s
    Compress::LZ4::decompress     2383127/s  23273 MiB/s
    Compress::Snappy::decompress  2068002/s  20195 MiB/s
    Compress::Bzip2::decompress     48650/s    475 MiB/s
    Compress::Zlib::uncompress       6342/s     62 MiB/s

<http://code.google.com/p/snappy/>

<https://github.com/zeevt/csnappy>

Please report any bugs or feature requests to <http://rt.cpan.org/Public/Bug/Report.html?Queue=Compress-Snappy>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.

    perldoc Compress::Snappy

You can also look for information at:

  • GitHub Source Repository

    <http://github.com/gray/compress-snappy>

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/Compress-Snappy>

  • CPAN Ratings

    <http://cpanratings.perl.org/d/Compress-Snappy>

  • RT: CPAN's request tracker

    <http://rt.cpan.org/Public/Dist/Display.html?Name=Compress-Snappy>

  • Search CPAN

    <http://search.cpan.org/dist/Compress-Snappy/>

Copyright (C) 2011-2015 gray <gray at cpan.org>, all rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

gray, <gray at cpan.org>
2015-05-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.