From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751369AbdINIC6 (ORCPT ); Thu, 14 Sep 2017 04:02:58 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:43490 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdINIC5 (ORCPT ); Thu, 14 Sep 2017 04:02:57 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 14 Sep 2017 17:02:49 +0900 From: Minchan Kim To: Adam Borowski Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms Message-ID: <20170914080249.GB5533@bbox> References: <20170912050005.3247-1-sergey.senozhatsky@gmail.com> <20170912050005.3247-2-sergey.senozhatsky@gmail.com> <20170913071246.GB2975@bbox> <20170913103853.ko3iywrihcgtoiuf@angband.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170913103853.ko3iywrihcgtoiuf@angband.pl> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 13, 2017 at 12:38:56PM +0200, Adam Borowski wrote: > On Wed, Sep 13, 2017 at 04:12:46PM +0900, Minchan Kim wrote: > > On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote: > > > ZSTD tends to outperform deflate/inflate, thus we remove > > > zlib from the list of recommended algorithms and recommend > > > zstd instead. > > > > I did test with my sample data and compared zstd with deflate. > > zstd's compress ratio is lower a little bit but compression > > speed is much faster 3 times more and decompress speed is too > > 2 times more. With different data, it is different but overall, > > zstd would be better for speed at the cost of a little lower compress > > ratio(about 5%) so I believe it's worth to replace deflate. > > Both zlib and zstd have the compression level adjustable, zstd in a far > greater range (from lzo-like at lowest levels to mid-range lzma at the > highest). Thus, any such comparison needs to mention the used level. > Ie, if you selected a setting where speed is same, compression ratio > will be a lot better. Unfortunately, it seems crypto doesn't support configurable level yet so when I read the source properly, zstd default level is 3 while deflate is 6. > > For compressing RAM it's reasonable to keep to fastest levels, and a > non-adjustable level reduces complexity, but if your use case wants high but > slow compression, now is a good time to mention this. What I expect zstd is same comp ratio with zlib but much faster speed. And lastly, predefined dictionary for 4K comp/decomp. :) Thanks.