> On Nov 1, 2018, at 5:57 AM, Timofey Titovets <nefelim...@gmail.com> wrote:
> 
> ср, 31 окт. 2018 г. в 21:12, Nick Terrell <terre...@fb.com>:
>> 
>> From: Jennifer Liu <jenniferliu...@fb.com>
>> 
>> Adds zstd compression level support to btrfs. Zstd requires
>> different amounts of memory for each level, so the design had
>> to be modified to allow set_level() to allocate memory. We
>> preallocate one workspace of the maximum size to guarantee
>> forward progress. This feature is expected to be useful for
>> read-mostly filesystems, or when creating images.
>> 
>> Benchmarks run in qemu on Intel x86 with a single core.
>> The benchmark measures the time to copy the Silesia corpus [0] to
>> a btrfs filesystem 10 times, then read it back.
>> 
>> The two important things to note are:
>> - The decompression speed and memory remains constant.
>>  The memory required to decompress is the same as level 1.
>> - The compression speed and ratio will vary based on the source.
>> 
>> Level   Ratio   Compression     Decompression   Compression Memory
>> 1       2.59    153 MB/s        112 MB/s        0.8 MB
>> 2       2.67    136 MB/s        113 MB/s        1.0 MB
>> 3       2.72    106 MB/s        115 MB/s        1.3 MB
>> 4       2.78    86  MB/s        109 MB/s        0.9 MB
>> 5       2.83    69  MB/s        109 MB/s        1.4 MB
>> 6       2.89    53  MB/s        110 MB/s        1.5 MB
>> 7       2.91    40  MB/s        112 MB/s        1.4 MB
>> 8       2.92    34  MB/s        110 MB/s        1.8 MB
>> 9       2.93    27  MB/s        109 MB/s        1.8 MB
>> 10      2.94    22  MB/s        109 MB/s        1.8 MB
>> 11      2.95    17  MB/s        114 MB/s        1.8 MB
>> 12      2.95    13  MB/s        113 MB/s        1.8 MB
>> 13      2.95    10  MB/s        111 MB/s        2.3 MB
>> 14      2.99    7   MB/s        110 MB/s        2.6 MB
>> 15      3.03    6   MB/s        110 MB/s        2.6 MB
>> 
>> [0] http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
>> 
>> Signed-off-by: Jennifer Liu <jenniferliu...@fb.com>
>> Signed-off-by: Nick Terrell <terre...@fb.com>
>> Reviewed-by: Omar Sandoval <osan...@fb.com>

<snip>

> 
> You didn't mention, so:
> Did you test compression ratio/performance with compress-force or just 
> compress?

I tested with compress-force, since I just reused my script from before [0].

I reran some levels with compress and got these numbers:

Level   Ratio   Compression     Decompression
1       2.21    158 MB/s        113 MB/s
3       2.28    117 MB/s        113 MB/s
5       2.32    81  MB/s        112 MB/s
7       2.37    47  MB/s        116 MB/s
15      2.41    7   MB/s        115 MB/s

Using compress probably makes sense with lower levels, to get higher write 
speeds,
but if you're using higher compression levels, you'll likely want to use 
compress-force,
since you likely don't care too much about write speeds. Obviously this will 
depend on
the data you're compressing.

[0] https://gist.github.com/terrelln/51ed3c9da6f94d613c01fcdae60567e8

-Nick

> 
> Thanks.
> 
> -- 
> Have a nice day,
> Timofey.

Reply via email to