Author: kotkov
Date: Wed Aug 23 14:16:15 2017
New Revision: 1805897

URL: http://svn.apache.org/viewvc?rev=1805897&view=rev
Log:
fsfs: Make LZ4 the new default compression algorithm for all (new and
upgraded) format 8 repositories.

Using a faster compression algorithm results in a visible performance
improvement for both read and write operations.  This is a trade-off, as
the compression ratio of the on disk data will be lower than with the
previously used zlib-5, and the projected size of the repositories will
increase accordingly.  However, the actual reduction in the compression
ratio can be considered an acceptable price for the gained benefits.

Here are some of the zlib-5 vs LZ4 compression benchmarks over file://
protocol on an SSD disk:

  - One compressible file, 1.17 GB:

    Import time:  40.79 s  →  11.97 s   (3.4 x faster)
    Export time:  6.30 s  →  3.13 s   (2.0 x faster)
    Compression ratio:  31.8 %  →  43.8%   (384 MB → 529 MB on disk)

  - One incompressible file, 833 MB:

    Import time:  32.16 s  →  8.22 s   (3.9 x faster)
    Export time:  2.71 s  →  2.06 s   (1.3 x faster)
    Compression ratio:  91.9 %  →  93.3%   (766 MB → 778 MB on disk)

  - Multiple source code files (TortoiseSVN trunk), 213 MB, ~7,000 files:

    Import time:  17.83 s  →  10.36 s   (1.7 x faster)
    Export time:  1.62 s  →  1.15 s   (1.4 x faster)
    Compression ratio:  35.2 %  →  48.8 %   (75 MB → 104 MB on disk)

  - Multiple binary files, 1.68 GB, 25 files:

    Import time:  55.10 s  →  15.84 s   (3.5 x faster)
    Export time:  8.56 s  →  4.34 s   (2.0 x faster)
    Compression ratio:  38.4 %  →  46.9 %   (662 MB → 807 MB on disk)

The related discussion is in:
https://lists.apache.org/thread.html/b0ceb1a021b4adf795bf853f0634b09c2922b9ca3e26af18c7d3b7ee@%3Cdev.subversion.apache.org%3E

* subversion/libsvn_fs_fs/fs_fs.c
  (read_config): Default to LZ4 for format 8 repositories.
  (write_config): Mention the new default in the fsfs.conf template.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1805897&r1=1805896&r2=1805897&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Wed Aug 23 14:16:15 2017
@@ -904,8 +904,13 @@ read_config(fs_fs_data_t *ffd,
         }
       else
         {
-          /* Nothing specified explicitly, use default settings. */
-          ffd->delta_compression_type = compression_type_zlib;
+          /* Nothing specified explicitly, use the default settings:
+           * LZ4 compression for formats supporting it and zlib otherwise. */
+          if (ffd->format >= SVN_FS_FS__MIN_SVNDIFF2_FORMAT)
+            ffd->delta_compression_type = compression_type_lz4;
+          else
+            ffd->delta_compression_type = compression_type_zlib;
+
           ffd->delta_compression_level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
         }
     }
@@ -1059,11 +1064,14 @@ write_config(svn_fs_t *fs,
 "### incompressible files.  Note that the compression ratio of lz4 is"       NL
 "### usually lower than the one provided by zlib, but using it can"          NL
 "### significantly speed up commits as well as reading the data."            NL
+"### lz4 compression algorithm is supported, starting from format 8"         NL
+"### repositories, available in Subversion 1.10 and higher."                 NL
 "### The syntax of this option is:"                                          NL
 "###   " CONFIG_OPTION_COMPRESSION " = none | lz4 | zlib | zlib-1 ... zlib-9" 
NL
 "### Versions prior to Subversion 1.10 will ignore this option."             NL
-"### The default value is 'zlib', which is currently equivalent to 'zlib-5'." 
NL
-"# " CONFIG_OPTION_COMPRESSION " = zlib"                                     NL
+"### The default value is 'lz4' if supported by the repository format and"   NL
+"### 'zlib' otherwise.  'zlib' is currently equivalent to 'zlib-5'."         NL
+"# " CONFIG_OPTION_COMPRESSION " = lz4"                                      NL
 "###"                                                                        NL
 "### DEPRECATED: The new '" CONFIG_OPTION_COMPRESSION "' option deprecates 
previously used" NL
 "### '" CONFIG_OPTION_COMPRESSION_LEVEL "' option, which was used to configure 
zlib compression." NL


Reply via email to