mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dave@jikos.cz>
To: Andi Kleen <andi@firstfloor.org>
Cc: chris.mason@oracle.com, linux-kernel@vger.kernel.org,
	linux-btrfs@vger.kernel.org
Subject: Re: Updated btrfs/crypto snappy interface ready for merging
Date: Tue, 17 Jan 2012 10:07:46 +0100	[thread overview]
Message-ID: <20120117090746.GD7322@twin.jikos.cz> (raw)
In-Reply-To: <1326414530-10789-1-git-send-email-andi@firstfloor.org>

On Thu, Jan 12, 2012 at 04:28:47PM -0800, Andi Kleen wrote:
> Here's a slightly updated version of the BTRFS snappy interface.
> snappy is a faster compression algorithm that provides similar
> compression as LZO, but generally better performance.

Recently the LZ4 method showed up on the real-time compression scene

http://fastcompression.blogspot.com/p/lz4.html (homepage)
http://code.google.com/p/lz4/ (source repo)

it has comparable performance and compression ratio to snappy. Quoting
from the source repo main page:

Name            Ratio   C.speed D.speed
LZ4 (r41)       2.08    319     1070
LZO 2.05 1x_1   2.07    318      466
Snappy 1.0.4    2.02    242      683

My own benchmarking confirms that lz4 is has a bit faster decompression,
but what is a big difference from snappy is it's memory consumption for
compression:
* 32kb for unbounded chunksize
* 16kb for chunksize < 64k (a tuned compression)

No additional memory is needed for decompression in both snappy and lz4.
With a minor tweak and chunksize < 4G the context size could be reduced
to 16k as well.

There is also LZ4HC, "high compression" mode, which maintains same
binary format, but the compression ratio is better.

http://code.google.com/p/lz4hc/

Usecase:
There could be the fast version used transparently and the -hc version
could be allowed for the 'fi defrag' command in order to recompress
selected files.

LZ4 is written in C and it's BSD, LZ4HC is L-GPL. There is some space
for improvements in the code, but as it's good already as it stands now.


david

  parent reply	other threads:[~2012-01-17 10:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  0:28 Andi Kleen
2012-01-13  0:28 ` [PATCH 1/3] Add the snappy-c compressor to lib v2 Andi Kleen
2012-02-14  4:29   ` Mitch Harder
2012-02-14 19:52     ` Andi Kleen
2012-02-15  0:43       ` Mitch Harder
2012-01-13  0:28 ` [PATCH 2/3] BTRFS: Add snappy support v2 Andi Kleen
2012-01-13  0:28 ` [PATCH 3/3] Add snappy interface to crypto API Andi Kleen
2012-01-16 13:54 ` Updated btrfs/crypto snappy interface ready for merging Chris Mason
2012-01-17  8:44   ` Li Zefan
2012-01-17  8:46     ` Andi Kleen
2012-01-17  8:56       ` Li Zefan
2012-01-17  9:27       ` Li Zefan
2012-01-17  9:51         ` Andi Kleen
2012-01-17  9:07 ` David Sterba [this message]
2012-01-18 15:05 ` Markus F.X.J. Oberhumer
2012-01-23 16:19   ` ANN: linux-kernel-lzo-2.06.20120123 - update LZO to v2.06 Markus F.X.J. Oberhumer
2012-01-23 19:12     ` Nitin Gupta
2012-01-25  1:36     ` Andi Kleen
2012-10-09  8:39       ` David Sterba
2012-07-16 18:30   ` ANNOUNCE: linux-kernel-lzo-20120716 - update LZO Markus F.X.J. Oberhumer
2012-07-19 20:58     ` richard -rw- weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120117090746.GD7322@twin.jikos.cz \
    --to=dave@jikos.cz \
    --cc=andi@firstfloor.org \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome