Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Google snappy in C for Linux Kernel

branch: master

Merge pull request #15 from gray/master

use correct compiler macro for DragonFlyBSD
latest commit af5954de37
zeevt authored September 16, 2013
Octocat-spinner-32 python move python toys February 28, 2012
Octocat-spinner-32 testdata check for memeory leaks March 26, 2011
Octocat-spinner-32 Makefile emove mention of runtime detected endiannes from makefile March 15, 2012
Octocat-spinner-32 README updated readme March 15, 2012
Octocat-spinner-32 TODO set LD_LIBRARY_PATH April 18, 2011
Octocat-spinner-32 block_compressor.c use 8kb work memory to compress 4kb pages, like google's code. April 20, 2011
Octocat-spinner-32 block_compressor_benchmark.txt update userspace benchmarks April 30, 2011
Octocat-spinner-32 cl_tester.c no-op in tester February 28, 2012
Octocat-spinner-32 csnappy.h port changes from upstream Google Snappy: compress 64k chunks and use… May 13, 2013
Octocat-spinner-32 csnappy_compat.h Sereal's csnappy Win32 fixes February 28, 2013
Octocat-spinner-32 csnappy_compress.c port changes from upstream Google Snappy: compress 64k chunks and use… May 13, 2013
Octocat-spinner-32 csnappy_decompress.c Sereal's csnappy Win32 fixes February 28, 2013
Octocat-spinner-32 csnappy_internal.h Sereal's csnappy Win32 fixes February 28, 2013
Octocat-spinner-32 csnappy_internal_userspace.h use correct compiler macro for DragonFlyBSD September 11, 2013
Octocat-spinner-32 debugfs_input.txt zram now uses headerless snappy streams to save 2 bytes and a few cpu… April 04, 2011
Octocat-spinner-32 kernel_3_2_10.patch a current linux kernel patch March 13, 2012
Octocat-spinner-32 snappy_tester.patch update snappy tester patch February 28, 2012
Octocat-spinner-32 unaligned_arm.s ARM optimizations. There will be more. In particular ARMv6 has unalig… March 11, 2012
Octocat-spinner-32 unaligned_test.c tester for ARM on android March 11, 2012
Octocat-spinner-32 userspace_benchmark.txt update userspace benchmarks April 30, 2011
Octocat-spinner-32 zram_benchmark.txt split zram benchmark from readme April 15, 2011
Octocat-spinner-32 zramtest2.sh big endian fixes, courtesy of debian ppc qemu image April 06, 2011
README
Google Snappy, available at http://code.google.com/p/snappy/
is a compression library designed for speed rather than compression ratios.

It is not a new concept by far. The Linux kernel currently uses LZO as the
 default fast compressor. Snappy works faster, though achieves less compression.

Google's code is written in C with a lot of C++. Some of the more interesting
 features that rely on C++ appear to have been elided from the open source
 version of Snappy.

Goals:
To get the codebase into a shape that can be accepted into the mainline
 Linux kernel and used with zram (http://code.google.com/p/compcache/).
Being able to compress vmlinux and initrd with Snappy is a secondary goal.
Same for support in Squashfs and other parts of the kernel that currently
 support LZO.

Results:
I cut out or ported to plain ANSI C the necessary code and headers.
To cause less confusion, I call this project (and files) csnappy.
The API looks right, but I welcome comments.
The code *has* been tested in kernel-space using a patched zram and it works.

The code has been tested in a qemu emulating a PowerPC Mac and ARMv5TE running
 Debian Wheezy.

I also use an ARMv6 Android phone for testing.

Testing on other hardware or platforms is welcome.

Note: The userspace tester is a hack, as is the shared library.

Someone wrote a perl wrapper for csnappy:
http://search.cpan.org/dist/Compress-Snappy/
https://github.com/gray/compress-snappy

Patch for upstream snappy tester is available: snappy_tester.patch
Patch for linux kernel is available: kernel_3_2_10.patch

Benchmark in userspace: userspace_benchmark.txt
Benchmark in kernel space with zram: zram_benchmark.txt
Something went wrong with that request. Please try again.