benchmarks (2019 update)
Not logged in

Back to RasterLite2 doc index



RasterLite2 reference Benchmarks (2019 update)

Intended scope

In recent years new and innovative lossless compression algorithms have been developed.
The current benchmark is intended to check and verify, through practical tests, how these new compression methods do practically perform under the most usual conditions.
More specifically, a comparison will be made between the relative performances of new and older lossless compression methods.

The contenders

The following general purpose lossless compression methods will be systematically compared:
Whenever possible and appropriate the following lossless compression methods specifically intended for images / rasters will be tested as well:

Note

Both LZ4 and ZSTD are internally used by the most recent versions of the Linux Kernel, and thus can be considered a sign for high quality and very stable code.

The most recent versions of the very popular libtiff already support the LZMA, WEBP and ZSTD compressions, and the same support is available on GDAL.


Testing generic datasets

We'll start by first testing several generic datasets, so to stress all compression methods under the most common conditions.
The same dataset will be compressed and then decompressed using each method, so to gather informations about:
Note: compressing is a more difficult operation than decompressing, and will always require more time.
The speed differences between the various compression algorithms will be more noticeable during compression, but also the differences in decompression speeds (although less impressive) are worthy of a careful evaluation.

test #1 - compression of many CSV files

Uncompressed SizeAlgorithmCompressed Size Compression RatioCompression TimeDecompression Time
0.97 GB LZ4289 MB3.466.550 sec2.256 sec
DEFLATE155 MB6.4433.079 sec2.159 sec
ZSTD110 MB9.092.924 sec1.313 sec
LZMA47 MB21.421220.329 sec10.179 sec

Quick assessment:

test #2 - compressing a SQLite database file

Uncompressed SizeAlgorithmCompressed Size Compression RatioCompression TimeDecompression Time
1.13 GB LZ4508 MB2.2910.333 sec2.123 sec
DEFLATE323 MB3.6054.343 sec3.173 sec
ZSTD219 MB5.314.331 sec1.522 sec
LZMA82 MB14.26646.670 sec17.930 sec

Quick assessment:

test #3 - compressing many Shapefiles

Uncompressed SizeAlgorithmCompressed Size Compression RatioCompression TimeDecompression Time
1.19 GB LZ40.99 GB1.206.413 sec0.893 sec
DEFLATE870 MB1.4048.004 sec4.553 sec
ZSTD880 MB1.395.416 sec1.292 sec
LZMA682 MB1.79740.077 sec45.624 sec

Quick assessment:

test #4 - compressing a Landsat 8 scene (satellite imagery)

Uncompressed SizeAlgorithmCompressed Size Compression RatioCompression TimeDecompression Time
1.78 GB LZ41.07 GB1.655.104 sec1.285 sec
DEFLATE928 MB1.9756.643 sec7.176 sec
ZSTD929 MB1.967.261 sec2.329 sec
LZMA798 MB2.29957.182 sec95.288 sec

Quick assessment:

Final assessment (and lessons learned)

Testing Raster Coverages

This second group of tests will concentrate on comparing the various lossless compression methods, as implemented by RasterLite2, for the encoding and decoding of Raster Coverage Tiles..

Test #5 - Grayscale Raster Coverage

Compression MethodDB SizeCompression RatioCompression TimeDecompression Time
NONE no compression481 MB1.0054sec1min 44sec
LZ4 very fast compression416 MB1.1659sec1min 48sec
DEFLATE zip compression349 MB1.381min 5sec1min 44sec
ZSTD fast compression346 MB1.391min 0sec1min 54sec
LZMA 7-zip compression345 MB1.403min 2sec2min 3sec
PNG lossless image format346 MB1.391min 8sec1min 41sec
LL_WEBP lossless WebP320 MB1.504min 27sec2min 02sec
LL_JP2 lossless Jpeg2000323 MB1.494min 26sec2min 21sec
CHARLS lossless JPEG339 MB1.422min 38sec2min 6sec

Quick assessment:

Test #6 - RGB Raster Coverage

Compression MethodDB SizeCompression RatioCompression TimeDecompression Time
NONE no compression1.51 GB1.001min 17sec1min 51sec
LZ4 very fast compression1.21 GB1.251min 31sec1min 47sec
DEFLATE zip compression800 MB1.941min 56sec1min 40sec
ZSTD fast compression816 MB1.901min 29sec1min 37sec
LZMA 7-zip compression710 MB2.187min 23sec2min 11sec
PNG lossless image format830 MB1.862min 29sec1min 49sec
LL_WEBP lossless WebP525 MB2.957min 18sec1min 48sec
LL_JP2 lossless Jpeg2000802 MB1.9211min 31sec3min 16sec
CHARLS lossless JPEG912 MB1.707min 54sec2min 47sec

Quick assessment:

Test #7 - Multispectral (4-bands) Raster Coverage

Compression MethodDB SizeCompression RatioCompression TimeDecompression Time
NONE no compression2.01 GB1.003min 18sec1min 55sec
LZ4 very fast compression1.61 GB1.243min 41sec1min 48sec
DEFLATE zip compression1.02 GB1.975min 5sec1min 42sec
ZSTD fast compression1.07 GB1.873min 35sec1min 46sec
LZMA 7-zip compression882 MB2.3411min 7sec2min 15sec
PNG lossless image format1.08 GB1.854min 43sec1min 47sec
LL_WEBP lossless WebP758 MB2.729min 36sec1min 51sec
LL_JP2 lossless Jpeg20001.05 GB1.9216min 23sec3min 53sec

Quick assessment:

Test #8 - Datagrid Raster Coverage (ASCII Grid - floating point single precision)

Compression MethodDB SizeCompression RatioCompression TimeDecompression Time
NONE no compression2.01 GB1.006min 30sec2min 6sec
LZ4 very fast compression845 MB2.456min 36sec2min 9sec
DEFLATE zip compression623 MB3.327min 2sec2min 6sec
ZSTD fast compression614 MB3.366min 26sec1min 55sec
LZMA 7-zip compression513 MB4.0311min 20sec3min 5sec

Quick assessment:

Test #9 - Datagrid Raster Coverage (TIFF - INT16)

Compression MethodDB SizeCompression RatioCompression TimeDecompression Time
NONE no compression480 MB1.0017sec1min 39sec
LZ4 very fast compression317 MB1.5121sec1min 48sec
DEFLATE zip compression205 MB2.3428sec1min 39sec
ZSTD fast compression207 MB2.3220sec1min 42sec
LZMA 7-zip compression168 MB2.862min 0sec2min 3sec

Quick assessment:

Conclusions

  1. For Raster Coverages, general purpose, lossless compression algorithms, can be successfully deployed.
    They are never able to achieve an impressive compression ratio (for which a lossy compression is required), but they can effectively ensure a valuable reduction of required storage space - without imposing any loss of information.
    And some of them are fast enough to not impose an overhead::
    • LZ4 doesn't seem to be advisable for the compression of raster data.
      Although it is true, tends to be very fast; but not very effective in its compression ratio to be really interesting.
      It can be consider more as a research/academic tool, that is difficult to use in a production environments.
    • DEFLATE and ZSTD are almost on par for the use with raster data; both are well balanced and effectively useful.
      ZSTD often shows a clear superiority in speed and/or compression ratios, but the results are practically unpredictable, due the unknown factor of reoccurring patterns of the source data.
      A careful evaluation, through a case by case, practical test is always required. Assume that there is no reliable, general, rule.
    • LZMA is unbeatable for its compression ratio, but so deadly slow during decompression that discourages its adoption in production environments.
      Its best use probably is only for long term storage of really huge raster coverages, where high compression ratios can easily overcome any consideration about speed.
  2. Lossless compression algorithms specifically designed for raster images do not necessarily bring better results.
    They are too often unable to achieve a better compression ratio than the general purpose algorithms, and as a general rule they are unacceptably slow during decompression.
    Sometimes being too sophisticated and complex doesn't always pay off: and this seems to be true in this case.
    • PNG results are clearly the best of this group.
      It's a true image format but has (more or less) the same compression ratio and speeds as DEFLATE or ZSTD, and not at all surprising considereing that PNG is based on DEFLATE.
    • WebP (in its lossless mode) is only marginally interesting.
      Sometimes (but not always) it can achieve a better compression ratio than DEFLATE, ZSTD and PNG without imposing any noticeable bottleneck.
    • CharLS (aka lossless JPEG) and Jpeg2000 (in its lossless mode) are definitely not at all interesting.
      Both them are unable to achieve any interesting compression ratio, and are deadly slow (most noticeably LL_JP2).
      LZMA can easily achieve a better compression ratio with more or less the same level of speed (i.e. slow).
  3. Note: DEFLATE, ZSTD and PNG require about the same decompression time as NONE (no compression at all); and sometimes they are even marginally faster.
    This is a very relevant finding, because it confirms that the deployment of a compressed Raster Coverage and without the danger of causing a bottleneck performance.
    • A short rationale: every (de)compression will requires more CPU cycles, but compression will always cause less I/O operations.
      On a modern hardware system, this is a beneficial trade off,so the processing of compressed data will usually be on par (or even faster) then processing uncompressed data.



Back to RasterLite2 doc index