Skip to content
  • Gao Xiang's avatar
    lib/lz4: update LZ4 decompressor module · 2209fda3
    Gao Xiang authored
    Update the LZ4 compression module based on LZ4 v1.8.3 in order for the
    erofs file system to use the newest LZ4_decompress_safe_partial() which
    can now decode exactly the nb of bytes requested [1] to take place of the
    open hacked code in the erofs file system itself.
    
    Currently, apart from the erofs file system, no other users use
    LZ4_decompress_safe_partial, so no worry about the interface.
    
    In addition, LZ4 v1.8.x boosts up decompression speed compared to the
    current code which is based on LZ4 v1.7.3, mainly due to shortcut
    optimization for the specific common LZ4-sequences [2].
    
    lzbench testdata (tested in kirin710, 8 cores, 4 big cores
    at 2189Mhz, 2GB DDR RAM at 1622Mhz, with enwik8 testdata [3]):
    
    Compressor name         Compress. Decompress. Compr. size  Ratio Filename
    memcpy                   5004 MB/s  4924 MB/s   100000000 100.00 enwik8
    lz4hc 1.7.3 -9             12 MB/s   653 MB/s    42203253  42.20 enwik8
    lz4hc 1.8.0 -9             12 MB/s   908 MB/s    42...
    2209fda3