Artifact
3e9bc0d9c13c8a9a75e4ccca5dbce501ab8cb878:
Wiki page
[benchmarks (2019 update)] by
sandro
2019-02-07 09:43:24.
0000: 44 20 32 30 31 39 2d 30 32 2d 30 37 54 30 39 3a D 2019-02-07T09:
0010: 34 33 3a 32 34 2e 37 31 34 0a 4c 20 62 65 6e 63 43:24.714.L benc
0020: 68 6d 61 72 6b 73 5c 73 28 32 30 31 39 5c 73 75 hmarks\s(2019\su
0030: 70 64 61 74 65 29 0a 50 20 61 61 36 31 34 62 33 pdate).P aa614b3
0040: 33 65 35 39 34 66 65 36 34 30 34 62 66 33 61 37 3e594fe6404bf3a7
0050: 32 30 30 37 37 37 36 61 64 32 38 31 61 32 61 33 2007776ad281a2a3
0060: 38 0a 55 20 73 61 6e 64 72 6f 0a 57 20 31 39 34 8.U sandro.W 194
0070: 33 31 0a 42 61 63 6b 20 74 6f 20 3c 61 20 68 72 31.Back to <a hr
0080: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e ef="https://www.
0090: 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 gaia-gis.it/foss
00a0: 69 6c 2f 6c 69 62 72 61 73 74 65 72 6c 69 74 65 il/librasterlite
00b0: 32 2f 77 69 6b 69 3f 6e 61 6d 65 3d 72 61 73 74 2/wiki?name=rast
00c0: 65 72 6c 69 74 65 32 2d 64 6f 63 22 3e 52 61 73 erlite2-doc">Ras
00d0: 74 65 72 4c 69 74 65 32 20 64 6f 63 20 69 6e 64 terLite2 doc ind
00e0: 65 78 3c 2f 61 3e 3c 68 72 3e 3c 62 72 3e 0d 0a ex</a><hr><br>..
00f0: 3c 68 31 3e 52 61 73 74 65 72 4c 69 74 65 32 20 <h1>RasterLite2
0100: 72 65 66 65 72 65 6e 63 65 20 42 65 6e 63 68 6d reference Benchm
0110: 61 72 6b 73 20 28 32 30 31 39 20 75 70 64 61 74 arks (2019 updat
0120: 65 29 3c 2f 68 31 3e 0d 0a 3c 68 32 3e 49 6e 74 e)</h1>..<h2>Int
0130: 65 6e 64 65 64 20 73 63 6f 70 65 73 3c 2f 68 32 ended scopes</h2
0140: 3e 0d 0a 49 6e 20 72 65 63 65 6e 74 20 79 65 61 >..In recent yea
0150: 72 73 20 6e 65 77 20 61 6e 64 20 69 6e 6e 6f 76 rs new and innov
0160: 61 74 69 76 65 20 3c 61 20 68 72 65 66 3d 22 68 ative <a href="h
0170: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
0180: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4c 6f 73 dia.org/wiki/Los
0190: 73 6c 65 73 73 5f 63 6f 6d 70 72 65 73 73 69 6f sless_compressio
01a0: 6e 22 3e 6c 6f 73 73 6c 65 73 73 20 63 6f 6d 70 n">lossless comp
01b0: 72 65 73 73 69 6f 6e 20 61 6c 67 6f 72 69 74 68 ression algorith
01c0: 6d 73 3c 2f 61 3e 20 68 61 76 65 20 62 65 65 6e ms</a> have been
01d0: 20 64 65 76 65 6c 6f 70 65 64 2e 3c 62 72 3e 0d developed.<br>.
01e0: 0a 54 68 65 20 63 75 72 72 65 6e 74 20 62 65 6e .The current ben
01f0: 63 68 6d 61 72 6b 20 69 73 20 69 6e 74 65 6e 64 chmark is intend
0200: 65 64 20 74 6f 20 63 68 65 63 6b 20 61 6e 64 20 ed to check and
0210: 76 65 72 69 66 79 20 62 79 20 70 72 61 63 74 69 verify by practi
0220: 63 61 6c 20 74 65 73 74 69 6e 67 20 68 6f 77 20 cal testing how
0230: 74 68 65 73 65 20 6e 65 77 20 63 6f 6d 70 72 65 these new compre
0240: 73 73 69 6f 6e 20 6d 65 74 68 6f 64 73 20 64 6f ssion methods do
0250: 20 70 72 61 63 74 69 63 61 6c 6c 79 20 70 65 72 practically per
0260: 66 6f 72 6d 20 75 6e 64 65 72 20 74 68 65 20 6d form under the m
0270: 6f 73 74 20 75 73 75 61 6c 20 63 6f 6e 64 69 74 ost usual condit
0280: 69 6f 6e 73 2e 3c 62 72 3e 0d 0a 4d 6f 72 65 20 ions.<br>..More
0290: 73 70 65 63 69 66 69 63 61 6c 6c 79 2c 20 61 20 specifically, a
02a0: 63 6f 6d 70 61 72 69 73 6f 6e 20 77 69 6c 6c 20 comparison will
02b0: 62 65 20 6d 61 64 65 20 62 65 74 77 65 65 6e 20 be made between
02c0: 74 68 65 20 72 65 6c 61 74 69 76 65 20 70 65 72 the relative per
02d0: 66 6f 72 6d 61 6e 63 65 73 20 6f 66 20 6e 65 77 formances of new
02e0: 20 61 6e 64 20 6f 6c 64 65 72 20 6c 6f 73 73 6c and older lossl
02f0: 65 73 73 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 ess compression
0300: 6d 65 74 68 6f 64 73 2e 0d 0a 3c 68 32 3e 54 68 methods...<h2>Th
0310: 65 20 63 6f 6e 74 65 6e 64 65 72 73 3c 2f 68 32 e contenders</h2
0320: 3e 0d 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 >..The following
0330: 20 3c 62 3e 3c 69 3e 67 65 6e 65 72 61 6c 20 70 <b><i>general p
0340: 75 72 70 6f 73 65 3c 2f 69 3e 3c 2f 62 3e 20 6c urpose</i></b> l
0350: 6f 73 73 6c 65 73 73 20 63 6f 6d 70 72 65 73 73 ossless compress
0360: 69 6f 6e 20 6d 65 74 68 6f 64 73 20 77 69 6c 6c ion methods will
0370: 20 62 65 20 73 79 73 74 65 6d 61 74 69 63 61 6c be systematical
0380: 6c 79 20 63 6f 6d 70 61 72 65 64 3a 0d 0a 3c 75 ly compared:..<u
0390: 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 44 45 46 4c 41 l>..<li><b>DEFLA
03a0: 54 45 3c 2f 62 3e 3a 20 28 61 6b 61 20 3c 62 3e TE</b>: (aka <b>
03b0: 5a 69 70 3c 2f 62 3e 29 3c 62 72 3e 0d 0a 3c 61 Zip</b>)<br>..<a
03c0: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 href="https://e
03d0: 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f n.wikipedia.org/
03e0: 77 69 6b 69 2f 44 45 46 4c 41 54 45 22 3e 54 68 wiki/DEFLATE">Th
03f0: 69 73 3c 2f 61 3e 20 69 73 20 74 68 65 20 6d 6f is</a> is the mo
0400: 73 74 20 63 6c 61 73 73 69 63 20 61 6e 64 20 61 st classic and a
0410: 6c 6d 6f 73 74 20 75 6e 69 76 65 72 73 61 6c 6c lmost universall
0420: 79 20 61 64 6f 70 74 65 64 20 6c 6f 73 73 6c 65 y adopted lossle
0430: 73 73 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 6d ss compression m
0440: 65 74 68 6f 64 2e 3c 62 72 3e 0d 0a 49 74 20 77 ethod.<br>..It w
0450: 61 73 20 69 6e 69 74 69 61 6c 6c 79 20 69 6e 74 as initially int
0460: 72 6f 64 75 63 65 64 20 61 62 6f 75 74 20 33 30 roduced about 30
0470: 20 79 65 61 72 73 20 61 67 6f 20 28 69 6e 20 3c years ago (in <
0480: 62 3e 31 39 39 31 3c 2f 62 3e 29 2c 20 73 6f 20 b>1991</b>), so
0490: 69 74 20 63 61 6e 20 62 65 20 61 73 73 75 6d 65 it can be assume
04a0: 64 20 74 6f 20 62 65 20 74 68 65 20 76 65 6e 65 d to be the vene
04b0: 72 61 62 6c 65 20 64 65 63 61 6e 65 20 6f 66 20 rable decane of
04c0: 61 6c 6c 20 74 68 65 6d 2e 3c 2f 6c 69 3e 0d 0a all them.</li>..
04d0: 3c 6c 69 3e 3c 62 3e 4c 5a 4d 41 3c 2f 62 3e 3a <li><b>LZMA</b>:
04e0: 20 28 61 6b 61 20 3c 62 3e 37 2d 5a 69 70 3c 2f (aka <b>7-Zip</
04f0: 62 3e 29 3c 62 72 3e 0d 0a 3c 61 20 68 72 65 66 b>)<br>..<a href
0500: 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b ="https://en.wik
0510: 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f ipedia.org/wiki/
0520: 4c 65 6d 70 65 6c 25 45 32 25 38 30 25 39 33 5a Lempel%E2%80%93Z
0530: 69 76 25 45 32 25 38 30 25 39 33 4d 61 72 6b 6f iv%E2%80%93Marko
0540: 76 5f 63 68 61 69 6e 5f 61 6c 67 6f 72 69 74 68 v_chain_algorith
0550: 6d 22 3e 54 68 69 73 3c 2f 61 3e 20 69 73 20 61 m">This</a> is a
0560: 20 77 65 6c 6c 20 6b 6e 6f 77 6e 20 61 6e 64 20 well known and
0570: 77 69 64 65 6c 79 20 61 64 6f 70 74 65 64 20 6c widely adopted l
0580: 6f 73 73 6c 65 73 73 20 63 6f 6d 70 72 65 73 73 ossless compress
0590: 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c 62 72 3e 0d ion method.<br>.
05a0: 0a 49 74 27 73 20 79 6f 75 6e 67 65 72 20 74 68 .It's younger th
05b0: 61 6e 20 44 45 46 4c 41 54 45 20 68 61 76 69 6e an DEFLATE havin
05c0: 67 20 62 65 65 6e 20 69 6e 74 72 6f 64 75 63 65 g been introduce
05d0: 64 20 61 62 6f 75 74 20 32 30 20 79 65 61 72 73 d about 20 years
05e0: 20 61 67 6f 20 28 69 6e 20 3c 62 3e 31 39 39 38 ago (in <b>1998
05f0: 3c 2f 62 3e 29 2e 20 4c 5a 4d 41 20 69 73 20 61 </b>). LZMA is a
0600: 6e 20 65 78 74 72 65 6d 69 73 74 20 69 6e 74 65 n extremist inte
0610: 72 70 72 65 74 61 74 69 6f 6e 20 6f 66 20 6c 6f rpretation of lo
0620: 73 73 6c 65 73 73 20 63 6f 6d 70 72 65 73 73 69 ssless compressi
0630: 6f 6e 2e 3c 62 72 3e 20 49 74 27 73 20 75 73 75 on.<br> It's usu
0640: 61 6c 6c 79 20 61 62 6c 65 20 74 6f 20 61 63 68 ally able to ach
0650: 69 65 76 65 20 72 65 61 6c 6c 79 20 69 6d 70 72 ieve really impr
0660: 65 73 73 69 76 65 20 63 6f 6d 70 72 65 73 73 69 essive compressi
0670: 6f 6e 20 72 61 74 69 6f 73 20 28 62 79 20 66 61 on ratios (by fa
0680: 72 20 62 65 74 74 65 72 20 74 68 61 6e 20 44 45 r better than DE
0690: 46 4c 41 54 45 20 63 61 6e 20 64 6f 29 2c 20 62 FLATE can do), b
06a0: 75 74 20 61 74 20 74 68 65 20 63 6f 73 74 20 6f ut at the cost o
06b0: 66 20 73 65 76 65 72 65 6c 79 20 73 61 63 72 69 f severely sacri
06c0: 66 69 63 69 6e 67 20 74 68 65 20 63 6f 6d 70 72 ficing the compr
06d0: 65 73 73 69 6f 6e 20 73 70 65 65 64 3b 20 4c 5a ession speed; LZ
06e0: 4d 41 20 63 61 6e 20 62 65 20 65 61 73 69 6c 79 MA can be easily
06f0: 20 64 65 61 64 6c 79 20 73 6c 6f 77 2e 3c 2f 6c deadly slow.</l
0700: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4c 5a 34 3c 2f i>..<li><b>LZ4</
0710: 62 3e 3c 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d b><br>..<a href=
0720: 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 "https://en.wiki
0730: 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4c pedia.org/wiki/L
0740: 5a 34 5f 28 63 6f 6d 70 72 65 73 73 69 6f 6e 5f Z4_(compression_
0750: 61 6c 67 6f 72 69 74 68 6d 29 22 3e 54 68 69 73 algorithm)">This
0760: 3c 2f 61 3e 20 69 73 20 61 20 6d 6f 72 65 20 6d </a> is a more m
0770: 6f 64 65 72 6e 20 61 6c 67 6f 72 69 74 68 6d 20 odern algorithm
0780: 68 61 76 69 6e 67 20 62 65 65 6e 20 69 6e 74 72 having been intr
0790: 6f 64 75 63 65 64 20 6c 65 73 73 20 74 68 61 6e oduced less than
07a0: 20 31 30 20 79 65 61 72 73 20 61 67 6f 20 28 69 10 years ago (i
07b0: 6e 20 3c 62 3e 32 30 31 31 3c 2f 62 3e 29 2c 20 n <b>2011</b>),
07c0: 73 6f 20 69 74 27 73 20 64 69 66 66 75 73 69 6f so it's diffusio
07d0: 6e 20 61 6e 64 20 61 64 6f 70 74 69 6f 6e 20 69 n and adoption i
07e0: 73 20 73 74 69 6c 6c 20 72 61 74 68 65 72 20 6c s still rather l
07f0: 69 6d 69 74 65 64 2e 3c 62 72 3e 0d 0a 4c 5a 34 imited.<br>..LZ4
0800: 20 74 6f 6f 20 69 73 20 61 6e 20 65 78 74 72 65 too is an extre
0810: 6d 69 73 74 20 69 6e 74 65 72 70 72 65 74 61 74 mist interpretat
0820: 69 6f 6e 20 6f 66 20 6c 6f 73 73 6c 65 73 73 20 ion of lossless
0830: 63 6f 6d 70 72 65 73 73 69 6f 6e 2c 20 62 75 74 compression, but
0840: 20 69 74 20 67 6f 65 73 20 65 78 61 63 74 6c 79 it goes exactly
0850: 20 69 6e 20 74 68 65 20 6f 70 70 6f 73 69 74 65 in the opposite
0860: 20 64 69 72 65 63 74 69 6f 6e 20 6f 66 20 4c 5a direction of LZ
0870: 4d 41 2e 3c 62 72 3e 0d 0a 49 74 27 73 20 73 74 MA.<br>..It's st
0880: 72 6f 6e 67 6c 79 20 6f 70 74 69 6d 69 7a 65 64 rongly optimized
0890: 20 73 6f 20 74 6f 20 62 65 20 65 78 74 72 65 6d so to be extrem
08a0: 65 6c 79 20 66 61 73 74 2c 20 62 75 74 20 61 74 ely fast, but at
08b0: 20 74 68 65 20 63 6f 73 74 20 6f 66 20 73 61 63 the cost of sac
08c0: 72 69 66 69 63 69 6e 67 20 74 68 65 20 63 6f 6d rificing the com
08d0: 70 72 65 73 73 69 6f 6e 20 72 61 74 69 6f 73 2e pression ratios.
08e0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 5a 53 </li>..<li><b>ZS
08f0: 54 44 3c 2f 62 3e 20 28 61 6b 61 20 3c 62 3e 5a TD</b> (aka <b>Z
0900: 73 74 61 6e 64 61 72 64 3c 2f 62 3e 29 3c 62 72 standard</b>)<br
0910: 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 70 >..<a href="http
0920: 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 s://en.wikipedia
0930: 2e 6f 72 67 2f 77 69 6b 69 2f 5a 73 74 61 6e 64 .org/wiki/Zstand
0940: 61 72 64 22 3e 54 68 69 73 3c 2f 61 3e 20 69 73 ard">This</a> is
0950: 20 61 20 76 65 72 79 20 72 65 63 65 6e 74 6c 79 a very recently
0960: 20 69 6e 74 72 6f 64 75 63 65 64 20 61 6c 67 6f introduced algo
0970: 72 69 74 68 6d 20 28 3c 62 3e 32 30 31 35 3c 2f rithm (<b>2015</
0980: 62 3e 29 2c 20 61 6e 64 20 69 74 27 73 20 61 64 b>), and it's ad
0990: 6f 70 74 69 6f 6e 20 69 73 20 73 74 69 6c 6c 20 option is still
09a0: 72 61 74 68 65 72 20 6c 69 6d 69 74 65 64 2e 3c rather limited.<
09b0: 62 72 3e 0d 0a 43 75 72 69 6f 75 73 6c 79 20 65 br>..Curiously e
09c0: 6e 6f 75 67 68 2c 20 62 6f 74 68 20 4c 5a 34 20 nough, both LZ4
09d0: 61 6e 64 20 5a 53 54 44 20 61 72 65 20 64 65 76 and ZSTD are dev
09e0: 65 6c 6f 70 65 64 20 61 6e 64 20 6d 61 69 6e 74 eloped and maint
09f0: 61 69 6e 65 64 20 62 79 20 74 68 65 20 73 61 6d ained by the sam
0a00: 65 20 61 75 74 68 6f 72 20 28 59 61 6e 6e 20 43 e author (Yann C
0a10: 6f 6c 6c 65 74 29 2e 3c 62 72 3e 0d 0a 5a 53 54 ollet).<br>..ZST
0a20: 44 20 69 73 20 61 20 77 65 6c 6c 20 62 61 6c 61 D is a well bala
0a30: 6e 63 65 64 20 61 6c 67 6f 72 69 74 68 6d 20 70 nced algorithm p
0a40: 72 65 74 65 6e 64 69 6e 67 20 74 6f 20 62 65 20 retending to be
0a50: 61 20 6d 6f 73 74 20 6d 6f 64 65 72 6e 20 72 65 a most modern re
0a60: 70 6c 61 63 65 6d 65 6e 74 20 66 6f 72 20 44 45 placement for DE
0a70: 46 4c 41 54 45 2c 20 62 65 69 6e 67 20 61 62 6c FLATE, being abl
0a80: 65 20 74 6f 20 62 65 20 66 61 73 74 65 72 20 61 e to be faster a
0a90: 6e 64 2f 6f 72 20 74 6f 20 61 63 68 69 65 76 65 nd/or to achieve
0aa0: 20 62 65 74 74 65 72 20 63 6f 6d 70 72 65 73 73 better compress
0ab0: 69 6f 6e 20 72 61 74 69 6f 73 2e 3c 62 72 3e 0d ion ratios.<br>.
0ac0: 0a 4a 75 73 74 20 66 65 77 20 74 65 63 68 6e 69 .Just few techni
0ad0: 63 61 6c 20 64 65 74 61 69 6c 73 20 61 62 6f 75 cal details abou
0ae0: 74 20 74 68 65 20 6d 6f 73 74 20 72 65 6c 65 76 t the most relev
0af0: 61 6e 74 20 69 6e 6e 6f 76 61 74 69 6f 6e 73 20 ant innovations
0b00: 69 6e 74 72 6f 64 75 63 65 64 20 62 79 20 5a 53 introduced by ZS
0b10: 54 44 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 54 TD:..<ul>..<li>T
0b20: 68 65 20 6f 6c 64 20 44 45 46 4c 41 54 45 20 77 he old DEFLATE w
0b30: 61 73 20 64 65 73 69 67 6e 65 64 20 73 6f 20 74 as designed so t
0b40: 6f 20 72 65 71 75 69 72 65 20 61 20 76 65 72 79 o require a very
0b50: 20 6c 69 6d 69 74 65 64 20 61 6d 6f 75 6e 74 20 limited amount
0b60: 6f 66 20 6d 65 6d 6f 72 79 2c 20 61 6e 64 20 74 of memory, and t
0b70: 68 69 73 20 69 6d 70 61 69 72 65 64 20 73 6f 6d his impaired som
0b80: 65 77 61 79 20 69 74 27 73 20 65 66 66 69 63 69 eway it's effici
0b90: 65 6e 63 79 2e 3c 62 72 3e 0d 0a 4d 6f 64 65 72 ency.<br>..Moder
0ba0: 6e 20 48 57 20 63 61 6e 20 65 61 73 69 6c 79 20 n HW can easily
0bb0: 73 75 70 70 6f 72 74 20 61 20 6c 6f 74 20 6f 66 support a lot of
0bc0: 20 6d 65 6d 6f 72 79 2c 20 73 6f 20 5a 53 54 44 memory, so ZSTD
0bd0: 20 62 6f 72 72 6f 77 73 20 66 65 77 20 69 64 65 borrows few ide
0be0: 61 73 20 66 72 6f 6d 20 4c 5a 4d 41 20 61 62 6f as from LZMA abo
0bf0: 75 74 20 61 20 6c 65 73 73 20 63 6f 6e 73 74 72 ut a less constr
0c00: 61 69 6e 65 64 20 61 6e 64 20 6d 6f 72 65 20 65 ained and more e
0c10: 66 66 69 63 69 65 6e 74 20 6d 65 6d 6f 72 79 20 fficient memory
0c20: 75 73 61 67 65 2e 3c 62 72 3e 0d 0a 4d 6f 72 65 usage.<br>..More
0c30: 20 73 70 65 63 69 66 69 63 61 6c 6c 79 2c 20 44 specifically, D
0c40: 45 46 4c 41 54 45 20 69 73 20 62 61 73 65 64 20 EFLATE is based
0c50: 6f 6e 20 61 20 6d 6f 76 69 6e 67 20 64 61 74 61 on a moving data
0c60: 20 77 69 6e 64 6f 77 20 6f 66 20 6f 6e 6c 79 20 window of only
0c70: 3c 62 3e 33 32 4b 42 3c 2f 62 3e 3b 20 62 6f 74 <b>32KB</b>; bot
0c80: 68 20 4c 5a 4d 41 20 61 6e 64 20 5a 53 54 44 20 h LZMA and ZSTD
0c90: 61 64 6f 70 74 20 61 20 6d 6f 72 65 20 67 65 6e adopt a more gen
0ca0: 65 72 6f 75 73 20 6d 6f 76 69 6e 67 20 77 69 6e erous moving win
0cb0: 64 6f 77 20 6f 66 20 3c 62 3e 31 4d 42 3c 2f 62 dow of <b>1MB</b
0cc0: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 42 6f 74 >.</li>..<li>Bot
0cd0: 68 20 44 45 46 4c 41 54 45 20 61 6e 64 20 5a 53 h DEFLATE and ZS
0ce0: 54 44 20 61 64 6f 70 74 73 20 74 68 65 20 63 6c TD adopts the cl
0cf0: 61 73 73 69 63 20 3c 61 20 68 72 65 66 3d 22 68 assic <a href="h
0d00: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
0d10: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 48 75 66 dia.org/wiki/Huf
0d20: 66 6d 61 6e 5f 63 6f 64 69 6e 67 22 3e 48 75 66 fman_coding">Huf
0d30: 66 6d 61 6e 20 63 6f 64 69 6e 67 3c 2f 61 3e 20 fman coding</a>
0d40: 66 6f 72 20 72 65 64 75 63 69 6e 67 20 74 68 65 for reducing the
0d50: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 65 6e 74 information ent
0d60: 72 6f 70 79 2e 3c 62 72 3e 0d 0a 42 75 74 20 5a ropy.<br>..But Z
0d70: 53 54 44 20 63 61 6e 20 61 6c 73 6f 20 73 75 70 STD can also sup
0d80: 70 6f 72 74 20 61 20 66 75 72 74 68 65 72 20 61 port a further a
0d90: 64 76 61 6e 63 65 64 20 6d 65 63 68 61 6e 69 73 dvanced mechanis
0da0: 6d 20 62 61 73 65 64 20 6f 6e 20 3c 61 20 68 72 m based on <a hr
0db0: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 ef="https://en.w
0dc0: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
0dd0: 69 2f 41 73 79 6d 6d 65 74 72 69 63 5f 6e 75 6d i/Asymmetric_num
0de0: 65 72 61 6c 5f 73 79 73 74 65 6d 73 23 74 41 4e eral_systems#tAN
0df0: 53 22 3e 46 69 6e 69 74 65 20 53 74 61 74 65 20 S">Finite State
0e00: 45 6e 74 72 6f 70 79 3c 2f 61 3e 2c 20 61 20 76 Entropy</a>, a v
0e10: 65 72 79 20 72 65 63 65 6e 74 20 74 65 63 68 6e ery recent techn
0e20: 69 71 75 65 20 62 65 69 6e 67 20 6d 75 63 68 20 ique being much
0e30: 66 61 73 74 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 2f faster.</li>..</
0e40: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d ul></li>..</ul>.
0e50: 0a 3c 62 72 3e 0d 0a 57 68 65 6e 65 76 65 72 20 .<br>..Whenever
0e60: 70 6f 73 73 69 62 6c 65 20 61 6e 64 20 61 70 70 possible and app
0e70: 72 6f 70 72 69 61 74 65 20 74 68 65 20 66 6f 6c ropriate the fol
0e80: 6c 6f 77 69 6e 67 20 6c 6f 73 73 6c 65 73 73 20 lowing lossless
0e90: 63 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68 compression meth
0ea0: 6f 64 73 20 73 70 65 63 69 66 69 63 61 6c 6c 79 ods specifically
0eb0: 20 69 6e 74 65 6e 64 65 64 20 66 6f 72 20 3c 62 intended for <b
0ec0: 3e 3c 69 3e 69 6d 61 67 65 73 20 2f 20 72 61 73 ><i>images / ras
0ed0: 74 65 72 73 3c 2f 69 3e 3c 2f 62 3e 20 77 69 6c ters</i></b> wil
0ee0: 6c 20 62 65 20 74 65 73 74 65 64 20 61 73 20 77 l be tested as w
0ef0: 65 6c 6c 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e ell:..<ul>..<li>
0f00: 3c 62 3e 50 4e 47 3c 2f 62 3e 3c 62 72 3e 0d 0a <b>PNG</b><br>..
0f10: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
0f20: 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 /en.wikipedia.or
0f30: 67 2f 77 69 6b 69 2f 50 6f 72 74 61 62 6c 65 5f g/wiki/Portable_
0f40: 4e 65 74 77 6f 72 6b 5f 47 72 61 70 68 69 63 73 Network_Graphics
0f50: 22 3e 54 68 69 73 3c 2f 61 3e 20 69 73 20 61 20 ">This</a> is a
0f60: 76 65 72 79 20 70 6f 70 75 6c 61 72 20 66 6f 72 very popular for
0f70: 6d 61 74 20 73 75 70 70 6f 72 74 69 6e 67 20 52 mat supporting R
0f80: 47 42 20 61 6e 64 20 47 72 61 79 73 63 61 6c 65 GB and Grayscale
0f90: 20 69 6d 61 67 65 73 20 28 77 69 74 68 20 6f 72 images (with or
0fa0: 20 77 69 74 68 6f 75 74 20 41 6c 70 68 61 20 74 without Alpha t
0fb0: 72 61 6e 73 70 61 72 65 6e 63 69 65 73 29 2e 3c ransparencies).<
0fc0: 62 72 3e 0d 0a 50 4e 47 20 66 75 6c 6c 79 20 64 br>..PNG fully d
0fd0: 65 70 65 6e 64 73 20 6f 6e 20 44 45 46 4c 41 54 epends on DEFLAT
0fe0: 45 20 66 6f 72 20 64 61 74 61 20 63 6f 6d 70 72 E for data compr
0ff0: 65 73 73 69 6f 6e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c ession.</li>..<l
1000: 69 3e 3c 62 3e 43 68 61 72 4c 53 3c 2f 62 3e 3c i><b>CharLS</b><
1010: 62 72 3e 0d 0a 54 68 69 73 20 69 73 20 61 6e 20 br>..This is an
1020: 69 6d 61 67 65 20 66 6f 72 6d 61 74 20 28 52 47 image format (RG
1030: 42 20 61 6e 64 20 47 72 61 79 73 63 61 6c 65 29 B and Grayscale)
1040: 20 68 61 76 69 6e 67 20 61 20 6c 69 6d 69 74 65 having a limite
1050: 64 20 64 69 66 66 75 73 69 6f 6e 20 62 75 74 20 d diffusion but
1060: 72 61 74 68 65 72 20 70 6f 70 75 6c 61 72 20 66 rather popular f
1070: 6f 72 20 73 74 6f 72 79 69 6e 67 20 6d 65 64 69 or storying medi
1080: 63 61 6c 20 69 6d 61 67 65 72 79 2e 3c 62 72 3e cal imagery.<br>
1090: 0d 0a 43 68 61 72 4c 53 20 69 73 20 62 61 73 65 ..CharLS is base
10a0: 64 20 6f 6e 20 3c 61 20 68 72 65 66 3d 22 68 74 d on <a href="ht
10b0: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
10c0: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4c 6f 73 73 ia.org/wiki/Loss
10d0: 6c 65 73 73 5f 4a 50 45 47 22 3e 4c 6f 73 73 6c less_JPEG">Lossl
10e0: 65 73 73 20 4a 50 45 47 3c 2f 61 3e 2c 20 61 20 ess JPEG</a>, a
10f0: 67 65 6e 75 69 6e 65 6c 79 20 6c 6f 73 73 6c 65 genuinely lossle
1100: 73 73 20 69 6d 61 67 65 20 63 6f 6d 70 72 65 73 ss image compres
1110: 73 69 6f 6e 20 73 63 68 65 6d 61 0d 0a 6e 6f 74 sion schema..not
1120: 20 74 6f 20 62 65 20 63 6f 6e 66 75 73 65 64 20 to be confused
1130: 77 69 74 68 20 70 6c 61 69 6e 20 4a 50 45 47 20 with plain JPEG
1140: 28 74 68 61 74 20 69 73 20 74 68 65 20 6d 6f 73 (that is the mos
1150: 74 20 63 6c 61 73 73 69 63 20 65 78 61 6d 70 6c t classic exampl
1160: 65 20 6f 66 20 3c 61 20 68 72 65 66 3d 22 68 74 e of <a href="ht
1170: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
1180: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4c 6f 73 73 ia.org/wiki/Loss
1190: 79 5f 63 6f 6d 70 72 65 73 73 69 6f 6e 22 3e 6c y_compression">l
11a0: 6f 73 73 79 20 63 6f 6d 70 72 65 73 73 69 6f 6e ossy compression
11b0: 3c 2f 61 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 </a>).</li>..<li
11c0: 3e 3c 62 3e 4a 70 65 67 32 30 30 30 3c 2f 62 3e ><b>Jpeg2000</b>
11d0: 3c 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 <br>..<a href="h
11e0: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
11f0: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4a 50 45 dia.org/wiki/JPE
1200: 47 5f 32 30 30 30 22 3e 54 68 69 73 3c 2f 61 3e G_2000">This</a>
1210: 20 69 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 is intended to
1220: 62 65 20 61 20 6d 6f 72 65 20 61 64 76 61 6e 63 be a more advanc
1230: 65 64 20 72 65 70 6c 61 63 65 6d 65 6e 74 20 66 ed replacement f
1240: 6f 72 20 4a 50 45 47 2c 20 62 75 74 20 69 74 27 or JPEG, but it'
1250: 73 20 6e 6f 74 20 79 65 74 20 73 6f 20 77 69 64 s not yet so wid
1260: 65 6c 79 20 73 75 70 70 6f 72 74 65 64 20 61 73 ely supported as
1270: 20 69 74 73 20 61 6e 63 65 73 74 6f 72 2e 3c 62 its ancestor.<b
1280: 72 3e 0d 0a 4a 70 65 67 32 30 30 30 20 69 73 20 r>..Jpeg2000 is
1290: 61 6e 20 69 6e 68 65 72 65 6e 74 6c 79 20 3c 62 an inherently <b
12a0: 3e 6c 6f 73 73 79 20 63 6f 6d 70 72 65 73 73 69 >lossy compressi
12b0: 6f 6e 3c 2f 62 3e 2c 20 62 75 74 20 75 6e 64 65 on</b>, but unde
12c0: 72 20 73 70 65 63 69 61 6c 20 73 65 74 74 69 6e r special settin
12d0: 67 73 20 69 74 20 63 61 6e 20 65 66 66 65 63 74 gs it can effect
12e0: 69 76 65 6c 79 20 73 75 70 70 6f 72 74 20 61 20 ively support a
12f0: 67 65 6e 75 69 6e 65 20 3c 62 3e 6c 6f 73 73 6c genuine <b>lossl
1300: 65 73 73 20 63 6f 6d 70 72 65 73 73 69 6f 6e 3c ess compression<
1310: 2f 62 3e 20 6d 6f 64 65 2e 3c 2f 6c 69 3e 0d 0a /b> mode.</li>..
1320: 3c 6c 69 3e 3c 62 3e 57 65 62 50 3c 2f 62 3e 3c <li><b>WebP</b><
1330: 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 74 br>..<a href="ht
1340: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
1350: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 57 65 62 50 ia.org/wiki/WebP
1360: 22 3e 54 68 69 73 3c 2f 61 3e 20 74 6f 6f 20 69 ">This</a> too i
1370: 73 20 61 6e 20 69 6e 6e 6f 76 61 74 69 76 65 20 s an innovative
1380: 69 6d 61 67 65 20 66 6f 72 6d 61 74 20 70 72 65 image format pre
1390: 74 65 6e 64 69 6e 67 20 74 6f 20 62 65 20 61 20 tending to be a
13a0: 62 65 74 74 65 72 20 72 65 70 6c 61 63 65 6d 65 better replaceme
13b0: 6e 74 20 66 6f 72 20 4a 50 45 47 2e 3c 62 72 3e nt for JPEG.<br>
13c0: 0d 0a 57 65 62 50 20 69 6d 61 67 65 73 20 61 72 ..WebP images ar
13d0: 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 73 75 e expected to su
13e0: 70 70 6f 72 74 20 74 68 65 20 73 61 6d 65 20 76 pport the same v
13f0: 69 73 75 61 6c 20 71 75 61 6c 69 74 79 20 6f 66 isual quality of
1400: 20 4a 50 45 47 20 62 75 74 20 72 65 71 75 69 72 JPEG but requir
1410: 69 6e 67 20 61 20 73 69 67 6e 69 66 69 63 61 6e ing a significan
1420: 74 6c 79 20 72 65 64 75 63 65 64 20 73 74 6f 72 tly reduced stor
1430: 61 67 65 20 73 70 61 63 65 2e 3c 62 72 3e 0d 0a age space.<br>..
1440: 45 78 61 63 74 6c 79 20 61 73 20 4a 70 65 67 32 Exactly as Jpeg2
1450: 30 30 30 2c 20 57 65 62 50 20 74 6f 6f 20 69 73 000, WebP too is
1460: 20 61 6e 20 69 6e 68 65 72 65 6e 74 6c 79 20 3c an inherently <
1470: 62 3e 6c 6f 73 73 79 20 63 6f 6d 70 72 65 73 73 b>lossy compress
1480: 69 6f 6e 3c 2f 62 3e 2c 20 62 75 74 20 75 6e 64 ion</b>, but und
1490: 65 72 20 73 70 65 63 69 61 6c 20 73 65 74 74 69 er special setti
14a0: 6e 67 73 20 69 74 20 63 61 6e 20 65 66 66 65 63 ngs it can effec
14b0: 74 69 76 65 6c 79 20 73 75 70 70 6f 72 74 20 61 tively support a
14c0: 20 67 65 6e 75 69 6e 65 20 3c 62 3e 6c 6f 73 73 genuine <b>loss
14d0: 6c 65 73 73 20 63 6f 6d 70 72 65 73 73 69 6f 6e less compression
14e0: 3c 2f 62 3e 20 6d 6f 64 65 2e 3c 2f 6c 69 3e 0d </b> mode.</li>.
14f0: 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 68 .</ul>..<br>..<h
1500: 72 3e 0d 0a 3c 68 31 3e 54 65 73 74 69 6e 67 20 r>..<h1>Testing
1510: 67 65 6e 65 72 69 63 20 64 61 74 61 73 65 74 73 generic datasets
1520: 3c 2f 68 31 3e 0d 0a 57 65 27 6c 6c 20 73 74 61 </h1>..We'll sta
1530: 72 74 20 66 69 72 73 74 20 62 79 20 74 65 73 74 rt first by test
1540: 69 6e 67 20 73 65 76 65 72 61 6c 20 67 65 6e 65 ing several gene
1550: 72 69 63 20 64 61 74 61 73 65 74 73 2c 20 73 6f ric datasets, so
1560: 20 74 6f 20 73 74 72 65 73 73 20 61 6c 6c 20 63 to stress all c
1570: 6f 6d 70 72 65 73 73 69 6f 6e 20 6d 65 74 68 6f ompression metho
1580: 64 73 20 75 6e 64 65 72 20 74 68 65 20 6d 6f 73 ds under the mos
1590: 74 20 63 6f 6d 6d 6f 6e 20 63 6f 6e 64 69 74 69 t common conditi
15a0: 6f 6e 73 2e 3c 62 72 3e 0d 0a 54 68 65 20 73 61 ons.<br>..The sa
15b0: 6d 65 20 64 61 74 61 73 65 74 20 77 69 6c 6c 20 me dataset will
15c0: 62 65 20 63 6f 6d 70 72 65 73 73 65 64 20 61 6e be compressed an
15d0: 64 20 74 68 65 6e 20 64 65 63 6f 6d 70 72 65 73 d then decompres
15e0: 73 65 64 20 75 73 69 6e 67 20 65 61 63 68 20 6d sed using each m
15f0: 65 74 68 6f 64 2c 20 73 6f 20 74 6f 20 67 61 74 ethod, so to gat
1600: 68 65 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 73 her informations
1610: 20 61 62 6f 75 74 3a 0d 0a 3c 75 6c 3e 0d 0a 3c about:..<ul>..<
1620: 6c 69 3e 74 68 65 20 3c 62 3e 73 69 7a 65 3c 2f li>the <b>size</
1630: 62 3e 20 6f 66 20 74 68 65 20 72 65 73 75 6c 74 b> of the result
1640: 69 6e 67 20 63 6f 6d 70 72 65 73 73 65 64 20 66 ing compressed f
1650: 69 6c 65 2e 3c 62 72 3e 0d 0a 54 68 65 20 72 61 ile.<br>..The ra
1660: 74 69 6f 20 62 65 74 77 65 65 6e 20 74 68 65 20 tio between the
1670: 75 6e 63 6f 6d 70 72 65 73 73 65 64 20 61 6e 64 uncompressed and
1680: 20 63 6f 6d 70 72 65 73 73 65 64 20 73 69 7a 65 compressed size
1690: 73 20 77 69 6c 6c 20 63 6f 72 72 65 73 70 6f 6e s will correspon
16a0: 64 20 74 6f 20 74 68 65 20 3c 62 3e 63 6f 6d 70 d to the <b>comp
16b0: 72 65 73 73 69 6f 6e 20 72 61 74 69 6f 3c 2f 62 ression ratio</b
16c0: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 >.</li>..<li>the
16d0: 20 3c 62 3e 74 69 6d 65 3c 2f 62 3e 20 72 65 71 <b>time</b> req
16e0: 75 69 72 65 64 20 74 6f 20 3c 62 3e 63 6f 6d 70 uired to <b>comp
16f0: 72 65 73 73 3c 2f 62 3e 20 74 68 65 20 6f 72 69 ress</b> the ori
1700: 67 69 6e 61 6c 20 64 61 74 61 73 65 74 2e 3c 2f ginal dataset.</
1710: 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e li>..<li>the <b>
1720: 74 69 6d 65 3c 2f 62 3e 20 72 65 71 75 69 72 65 time</b> require
1730: 64 20 74 6f 20 3c 62 3e 64 65 63 6f 6d 70 72 65 d to <b>decompre
1740: 73 73 3c 2f 62 3e 20 74 68 65 20 63 6f 6d 70 72 ss</b> the compr
1750: 65 73 73 65 64 20 66 69 6c 65 20 73 6f 20 74 6f essed file so to
1760: 20 72 65 63 6f 76 65 72 20 74 68 65 20 69 6e 69 recover the ini
1770: 74 69 61 6c 20 75 6e 63 6f 6d 70 72 65 73 73 65 tial uncompresse
1780: 64 20 64 61 74 61 73 65 74 2e 3c 2f 6c 69 3e 0d d dataset.</li>.
1790: 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 62 .</ul>..<br>..<b
17a0: 3e 4e 6f 74 65 3c 2f 62 3e 3a 20 63 6f 6d 70 72 >Note</b>: compr
17b0: 65 73 73 69 6e 67 20 69 73 20 61 20 6d 75 63 68 essing is a much
17c0: 20 68 61 72 64 65 72 20 6f 70 65 72 61 74 69 6f harder operatio
17d0: 6e 20 74 68 61 6e 20 64 65 63 6f 6d 70 72 65 73 n than decompres
17e0: 73 69 6e 67 2c 20 61 6e 64 20 77 69 6c 6c 20 61 sing, and will a
17f0: 6c 77 61 79 73 20 72 65 71 75 69 72 65 20 6d 6f lways require mo
1800: 72 65 20 74 69 6d 65 2e 3c 62 72 3e 0d 0a 54 68 re time.<br>..Th
1810: 65 20 73 70 65 65 64 20 64 69 66 66 65 72 65 6e e speed differen
1820: 63 65 73 20 62 65 74 77 65 65 6e 20 74 68 65 20 ces between the
1830: 76 61 72 69 6f 75 73 20 63 6f 6d 70 72 65 73 73 various compress
1840: 69 6f 6e 20 61 6c 67 6f 72 69 74 68 6d 73 20 77 ion algorithms w
1850: 69 6c 6c 20 62 65 20 73 74 72 6f 6e 67 20 61 6e ill be strong an
1860: 64 20 77 65 6c 6c 20 6d 61 72 6b 65 64 20 77 68 d well marked wh
1870: 65 6e 20 63 6f 6d 70 72 65 73 73 69 6e 67 2c 20 en compressing,
1880: 62 75 74 20 61 6c 73 6f 20 74 68 65 20 64 69 66 but also the dif
1890: 66 65 72 65 6e 63 65 73 20 69 6e 20 64 65 63 6f ferences in deco
18a0: 6d 70 72 65 73 73 69 6f 6e 20 73 70 65 65 64 73 mpression speeds
18b0: 20 28 61 6c 74 68 6f 75 67 68 20 6c 65 73 73 20 (although less
18c0: 69 6d 70 72 65 73 73 69 76 65 29 20 61 72 65 20 impressive) are
18d0: 77 6f 72 74 68 20 74 6f 20 62 65 20 63 61 72 65 worth to be care
18e0: 66 75 6c 6c 79 20 65 76 61 6c 75 61 74 65 64 2e fully evaluated.
18f0: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 66 6f 72 20 ..<ul>..<li>for
1900: 61 6e 79 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 any compression
1910: 61 6c 67 6f 72 69 74 68 6d 20 62 65 69 6e 67 20 algorithm being
1920: 73 6c 6f 77 20 28 6f 72 20 65 76 65 6e 20 76 65 slow (or even ve
1930: 72 79 20 73 6c 6f 77 29 20 77 68 65 6e 20 63 6f ry slow) when co
1940: 6d 70 72 65 73 73 69 6e 67 20 63 61 6e 20 62 65 mpressing can be
1950: 20 65 61 73 69 6c 79 20 63 6f 6e 73 69 64 65 72 easily consider
1960: 65 64 20 61 20 74 72 69 76 69 61 6c 20 61 6e 64 ed a trivial and
1970: 20 66 6f 72 67 69 76 61 62 6c 65 20 69 73 73 75 forgivable issu
1980: 65 2e 3c 62 72 3e 0d 0a 43 6f 6d 70 72 65 73 73 e.<br>..Compress
1990: 69 6f 6e 20 75 73 75 61 6c 6c 79 20 68 61 70 70 ion usually happ
19a0: 65 6e 73 20 6f 6e 6c 79 20 6f 6e 63 65 20 69 6e ens only once in
19b0: 20 74 68 65 20 6c 69 66 65 74 69 6d 65 20 6f 66 the lifetime of
19c0: 20 61 20 63 6f 6d 70 72 65 73 73 65 64 20 64 61 a compressed da
19d0: 74 61 73 65 74 2c 20 61 6e 64 20 74 68 65 72 65 taset, and there
19e0: 20 61 72 65 20 6d 61 6e 79 20 77 61 79 73 20 66 are many ways f
19f0: 6f 72 20 6d 69 6e 69 6d 69 7a 69 6e 67 20 74 68 or minimizing th
1a00: 65 20 61 64 76 65 72 73 65 20 65 66 66 65 63 74 e adverse effect
1a10: 73 20 6f 66 20 69 6e 74 72 69 6e 73 69 63 20 73 s of intrinsic s
1a20: 6c 6f 77 6e 65 73 73 2e 3c 62 72 3e 0d 0a 59 6f lowness.<br>..Yo
1a30: 75 20 63 6f 75 6c 64 20 65 2e 67 2e 20 63 6f 6d u could e.g. com
1a40: 70 72 65 73 73 20 79 6f 75 72 20 66 69 6c 65 73 press your files
1a50: 20 69 6e 20 62 61 74 63 68 20 6d 6f 64 65 2c 20 in batch mode,
1a60: 6d 61 79 20 62 65 20 64 75 72 69 6e 67 20 6f 66 may be during of
1a70: 66 2d 70 65 61 6b 20 68 6f 75 72 73 2c 20 61 6e f-peak hours, an
1a80: 64 20 69 6e 20 73 75 63 68 20 61 20 73 63 65 6e d in such a scen
1a90: 61 72 69 6f 20 72 65 61 63 68 69 6e 67 20 73 74 ario reaching st
1aa0: 72 6f 6e 67 65 72 20 63 6f 6d 70 72 65 73 73 69 ronger compressi
1ab0: 6f 6e 20 72 61 74 69 6f 73 20 63 6f 75 6c 64 20 on ratios could
1ac0: 65 61 73 69 6c 79 20 6a 75 73 74 69 66 79 20 61 easily justify a
1ad0: 20 6c 6f 6e 67 65 72 20 70 72 6f 63 65 73 73 20 longer process
1ae0: 74 69 6d 65 2e 3c 62 72 3e 0d 0a 4f 72 20 61 6c time.<br>..Or al
1af0: 74 65 72 6e 61 74 69 76 65 6c 79 20 79 6f 75 20 ternatively you
1b00: 63 6f 75 6c 64 20 65 6e 61 62 6c 65 20 28 69 66 could enable (if
1b10: 20 70 6f 73 73 69 62 6c 65 29 20 61 20 6d 75 6c possible) a mul
1b20: 74 69 74 68 72 65 61 64 20 63 6f 6d 70 72 65 73 tithread compres
1b30: 73 69 6f 6e 20 61 70 70 72 6f 61 63 68 20 28 70 sion approach (p
1b40: 61 72 61 6c 6c 65 6c 20 70 72 6f 63 65 73 73 69 arallel processi
1b50: 6e 67 29 2c 20 73 6f 20 74 6f 20 73 69 67 6e 69 ng), so to signi
1b60: 66 69 63 61 6e 74 6c 79 20 72 65 64 75 63 65 20 ficantly reduce
1b70: 74 68 65 20 72 65 71 75 69 72 65 64 20 74 69 6d the required tim
1b80: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 62 65 69 e.</li>..<li>bei
1b90: 6e 67 20 73 6c 6f 77 20 77 68 65 6e 20 64 65 63 ng slow when dec
1ba0: 6f 6d 70 72 65 73 73 69 6e 67 20 69 73 20 61 20 ompressing is a
1bb0: 6d 75 63 68 20 6d 6f 72 65 20 73 65 72 69 6f 75 much more seriou
1bc0: 73 20 69 73 73 75 65 2c 20 62 65 63 61 75 73 65 s issue, because
1bd0: 20 64 65 63 6f 6d 70 72 65 73 73 69 6f 6e 20 77 decompression w
1be0: 69 6c 6c 20 68 61 70 70 65 6e 20 6d 6f 72 65 20 ill happen more
1bf0: 66 72 65 71 75 65 6e 74 6c 79 3b 20 76 65 72 79 frequently; very
1c00: 20 66 72 65 71 75 65 6e 74 6c 79 20 69 6e 20 73 frequently in s
1c10: 6f 6d 65 20 73 70 65 63 69 66 69 63 20 73 63 65 ome specific sce
1c20: 6e 61 72 69 6f 2e 3c 62 72 3e 0d 0a 53 6f 20 61 nario.<br>..So a
1c30: 20 63 65 72 74 61 69 6e 20 64 65 67 72 65 65 20 certain degree
1c40: 6f 66 20 73 6c 6f 77 6e 65 73 73 20 69 6e 20 64 of slowness in d
1c50: 65 63 6f 6d 70 72 65 73 73 69 6f 6e 20 63 6f 75 ecompression cou
1c60: 6c 64 20 65 61 73 69 6c 79 20 62 65 63 6f 6d 65 ld easily become
1c70: 20 61 20 73 65 72 69 6f 75 73 20 62 6f 74 74 6c a serious bottl
1c80: 65 6e 65 63 6b 20 73 65 76 65 72 65 6c 79 20 6c eneck severely l
1c90: 69 6d 69 74 69 6e 67 20 74 68 65 20 6f 76 65 72 imiting the over
1ca0: 61 6c 6c 20 70 65 72 66 6f 72 6d 61 6e 63 65 73 all performances
1cb0: 20 6f 66 20 79 6f 75 72 20 73 79 73 74 65 6d 2e of your system.
1cc0: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 </li>..</ul>..<h
1cd0: 33 3e 74 65 73 74 20 23 31 20 2d 20 63 6f 6d 70 3>test #1 - comp
1ce0: 72 65 73 73 69 6e 67 20 6d 61 6e 79 20 43 53 56 ressing many CSV
1cf0: 20 66 69 6c 65 73 3c 2f 68 33 3e 0d 0a 3c 74 61 files</h3>..<ta
1d00: 62 6c 65 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d ble cellspacing=
1d10: 22 36 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d "6" cellpadding=
1d20: 22 38 22 20 62 6f 72 64 65 72 3d 22 31 22 20 62 "8" border="1" b
1d30: 67 63 6f 6c 6f 72 3d 22 23 66 66 66 66 65 30 22 gcolor="#ffffe0"
1d40: 3e 0d 0a 3c 74 72 3e 3c 74 68 20 62 67 63 6f 6c >..<tr><th bgcol
1d50: 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 55 6e 63 or="#d0ff90">Unc
1d60: 6f 6d 70 72 65 73 73 65 64 20 53 69 7a 65 3c 2f ompressed Size</
1d70: 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 th><th bgcolor="
1d80: 23 64 30 66 66 39 30 22 3e 41 6c 67 6f 72 69 74 #d0ff90">Algorit
1d90: 68 6d 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c hm</th><th bgcol
1da0: 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 43 6f 6d or="#d0ff90">Com
1db0: 70 72 65 73 73 65 64 20 53 69 7a 65 3c 2f 74 68 pressed Size</th
1dc0: 3e 0d 0a 09 3c 74 68 20 62 67 63 6f 6c 6f 72 3d >...<th bgcolor=
1dd0: 22 23 64 30 66 66 39 30 22 3e 43 6f 6d 70 72 65 "#d0ff90">Compre
1de0: 73 73 69 6f 6e 20 52 61 74 69 6f 3c 2f 74 68 3e ssion Ratio</th>
1df0: 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 <th bgcolor="#d0
1e00: 66 66 39 30 22 3e 43 6f 6d 70 72 65 73 73 69 6f ff90">Compressio
1e10: 6e 20 54 69 6d 65 3c 2f 74 68 3e 3c 74 68 20 62 n Time</th><th b
1e20: 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 gcolor="#d0ff90"
1e30: 3e 44 65 63 6f 6d 70 72 65 73 73 69 6f 6e 20 54 >Decompression T
1e40: 69 6d 65 3c 2f 74 68 3e 3c 2f 74 72 3e 0d 0a 3c ime</th></tr>..<
1e50: 74 72 3e 0d 0a 09 3c 74 68 20 72 6f 77 73 70 61 tr>...<th rowspa
1e60: 6e 3d 22 34 22 20 61 6c 69 67 6e 3d 22 63 65 6e n="4" align="cen
1e70: 74 65 72 22 3e 30 2e 39 37 20 47 42 3c 2f 74 64 ter">0.97 GB</td
1e80: 3e 0d 0a 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 >...<td align="c
1e90: 65 6e 74 65 72 22 3e 4c 5a 34 3c 2f 74 64 3e 3c enter">LZ4</td><
1ea0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
1eb0: 3e 32 38 39 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 >289 MB</td><td
1ec0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 33 align="center">3
1ed0: 2e 34 36 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 .46</td><td alig
1ee0: 6e 3d 22 72 69 67 68 74 22 3e 36 2e 35 35 30 20 n="right">6.550
1ef0: 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 sec</td><td alig
1f00: 6e 3d 22 72 69 67 68 74 22 3e 32 2e 32 35 36 20 n="right">2.256
1f10: 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d sec</td>..</tr>.
1f20: 0a 3c 74 72 20 62 67 63 6f 6c 6f 72 3d 22 23 64 .<tr bgcolor="#d
1f30: 66 64 64 63 30 22 3e 0d 0a 09 3c 74 64 20 61 6c fddc0">...<td al
1f40: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 44 45 46 ign="center">DEF
1f50: 4c 41 54 45 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 LATE</td><td ali
1f60: 67 6e 3d 22 72 69 67 68 74 22 3e 31 35 35 20 4d gn="right">155 M
1f70: 42 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d B</td><td align=
1f80: 22 63 65 6e 74 65 72 22 3e 36 2e 34 34 3c 2f 74 "center">6.44</t
1f90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
1fa0: 68 74 22 3e 33 33 2e 30 37 39 20 73 65 63 3c 2f ht">33.079 sec</
1fb0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 td><td align="ri
1fc0: 67 68 74 22 3e 32 2e 31 35 39 20 73 65 63 3c 2f ght">2.159 sec</
1fd0: 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 74 72 3e td>..</tr>..<tr>
1fe0: 0d 0a 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 ...<td align="ce
1ff0: 6e 74 65 72 22 3e 5a 53 54 44 3c 2f 74 64 3e 3c nter">ZSTD</td><
2000: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2010: 3e 31 31 30 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 >110 MB</td><td
2020: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 39 align="center">9
2030: 2e 30 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 .09</td><td alig
2040: 6e 3d 22 72 69 67 68 74 22 3e 32 2e 39 32 34 20 n="right">2.924
2050: 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 sec</td><td alig
2060: 6e 3d 22 72 69 67 68 74 22 3e 31 2e 33 31 33 20 n="right">1.313
2070: 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d sec</td>..</tr>.
2080: 0a 3c 74 72 20 62 67 63 6f 6c 6f 72 3d 22 23 64 .<tr bgcolor="#d
2090: 66 64 64 63 30 22 3e 0d 0a 09 3c 74 64 20 61 6c fddc0">...<td al
20a0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4c 5a 4d ign="center">LZM
20b0: 41 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d A</td><td align=
20c0: 22 72 69 67 68 74 22 3e 34 37 20 4d 42 3c 2f 74 "right">47 MB</t
20d0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
20e0: 74 65 72 22 3e 32 31 2e 34 32 3c 2f 74 64 3e 3c ter">21.42</td><
20f0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2100: 3e 31 32 32 30 2e 33 32 39 20 73 65 63 3c 2f 74 >1220.329 sec</t
2110: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
2120: 68 74 22 3e 31 30 2e 31 37 39 20 73 65 63 3c 2f ht">10.179 sec</
2130: 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 td>..</tr>..</ta
2140: 62 6c 65 3e 0d 0a 3c 62 3e 51 75 69 63 6b 20 61 ble>..<b>Quick a
2150: 73 73 65 73 73 6d 65 6e 74 3a 3c 2f 62 3e 0d 0a ssessment:</b>..
2160: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 54 68 65 20 73 61 <ul>..<li>The sa
2170: 6d 70 6c 65 20 77 61 73 20 61 20 74 61 72 62 61 mple was a tarba
2180: 6c 6c 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20 ll containing a
2190: 77 68 6f 6c 65 20 3c 61 20 68 72 65 66 3d 22 68 whole <a href="h
21a0: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
21b0: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 47 65 6e dia.org/wiki/Gen
21c0: 65 72 61 6c 5f 54 72 61 6e 73 69 74 5f 46 65 65 eral_Transit_Fee
21d0: 64 5f 53 70 65 63 69 66 69 63 61 74 69 6f 6e 22 d_Specification"
21e0: 3e 47 54 46 53 3c 2f 61 3e 20 64 61 74 61 73 65 >GTFS</a> datase
21f0: 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 65 78 t.</li>..<li>Tex
2200: 74 20 66 69 6c 65 73 20 61 72 65 20 75 73 75 61 t files are usua
2210: 6c 6c 79 20 65 78 70 65 63 74 65 64 20 74 6f 20 lly expected to
2220: 62 65 20 68 69 67 68 6c 79 20 63 6f 6d 70 72 65 be highly compre
2230: 73 73 69 62 6c 65 20 28 73 6f 20 6d 61 6e 79 20 ssible (so many
2240: 72 65 70 65 74 69 74 69 6f 6e 73 20 6f 66 20 74 repetitions of t
2250: 68 65 20 73 61 6d 65 20 77 6f 72 6c 64 73 20 61 he same worlds a
2260: 6e 64 20 76 61 6c 75 65 73 29 2c 20 61 6e 64 20 nd values), and
2270: 74 68 69 73 20 74 65 73 74 20 63 6f 6e 66 69 72 this test confir
2280: 6d 73 20 74 68 65 20 65 78 70 65 63 74 61 74 69 ms the expectati
2290: 6f 6e 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ons.</li>..<li><
22a0: 62 3e 4c 5a 34 3c 2f 62 3e 20 69 73 20 76 65 72 b>LZ4</b> is ver
22b0: 79 20 66 61 73 74 20 62 6f 74 68 20 77 68 65 6e y fast both when
22c0: 20 63 6f 6d 70 72 65 73 73 69 6e 67 20 61 6e 64 compressing and
22d0: 20 64 65 63 6f 6d 70 72 65 73 73 69 6e 67 2c 20 decompressing,
22e0: 62 75 74 20 74 68 65 20 63 6f 6d 70 72 65 73 73 but the compress
22f0: 69 6f 6e 20 72 61 74 69 6f 20 69 73 20 72 61 74 ion ratio is rat
2300: 68 65 72 20 64 69 73 61 70 70 6f 69 6e 74 69 6e her disappointin
2310: 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e g.</li>..<li><b>
2320: 44 45 46 4c 41 54 45 3c 2f 62 3e 20 69 73 20 61 DEFLATE</b> is a
2330: 20 76 65 72 79 20 65 66 66 65 63 74 69 76 65 20 very effective
2340: 61 6e 64 20 77 65 6c 6c 20 62 61 6c 61 6e 63 65 and well balance
2350: 64 20 63 6f 6d 70 72 6f 6d 69 73 65 20 62 65 74 d compromise bet
2360: 77 65 65 6e 20 73 70 65 65 64 20 61 6e 64 20 65 ween speed and e
2370: 66 66 65 63 74 69 76 65 6e 65 73 73 2e 3c 62 72 ffectiveness.<br
2380: 3e 0d 0a 49 74 20 73 63 6f 72 65 73 20 61 20 64 >..It scores a d
2390: 65 63 65 6e 74 20 63 6f 6d 70 72 65 73 73 69 6f ecent compressio
23a0: 6e 20 72 61 74 69 6f 20 61 6e 64 20 69 74 27 73 n ratio and it's
23b0: 20 66 61 73 74 20 65 6e 6f 75 67 68 20 62 6f 74 fast enough bot
23c0: 68 20 77 68 65 6e 20 63 6f 6d 70 72 65 73 73 69 h when compressi
23d0: 6e 67 20 61 6e 64 20 64 65 63 6f 6d 70 72 65 73 ng and decompres
23e0: 73 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e sing.</li>..<li>
23f0: 3c 62 3e 5a 53 54 44 3c 2f 62 3e 20 63 6c 65 61 <b>ZSTD</b> clea
2400: 72 6c 79 20 77 69 6e 73 20 74 68 69 73 20 66 69 rly wins this fi
2410: 72 73 74 20 6d 61 74 63 68 20 68 61 6e 64 73 20 rst match hands
2420: 64 6f 77 6e 3b 20 69 74 27 73 20 69 6d 70 72 65 down; it's impre
2430: 73 73 69 76 65 6c 79 20 66 61 73 74 20 28 69 6e ssively fast (in
2440: 20 62 6f 74 68 20 64 69 72 65 63 74 69 6f 6e 73 both directions
2450: 29 20 61 6e 64 20 69 74 20 73 63 6f 72 65 73 20 ) and it scores
2460: 61 20 76 65 72 79 20 67 6f 6f 64 20 63 6f 6d 70 a very good comp
2470: 72 65 73 73 69 6f 6e 20 72 61 74 69 6f 2e 3c 2f ression ratio.</
2480: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4c 5a 4d 41 li>..<li><b>LZMA
2490: 3c 2f 62 3e 20 73 63 6f 72 65 73 20 61 20 72 65 </b> scores a re
24a0: 61 6c 6c 79 20 69 6d 70 72 65 73 73 69 76 65 20 ally impressive
24b0: 63 6f 6d 70 72 65 73 73 69 76 65 20 72 61 74 69 compressive rati
24c0: 6f 2c 20 62 75 74 20 69 74 27 73 20 64 65 61 64 o, but it's dead
24d0: 6c 79 20 73 6c 6f 77 20 77 68 65 6e 20 63 6f 6d ly slow when com
24e0: 70 72 65 73 73 69 6e 67 20 28 6d 6f 72 65 20 74 pressing (more t
24f0: 68 61 6e 20 31 30 20 74 69 6d 65 73 20 73 6c 6f han 10 times slo
2500: 77 65 72 20 74 68 61 6e 20 44 45 46 4c 41 54 45 wer than DEFLATE
2510: 29 2e 3c 62 72 3e 0d 0a 42 75 74 20 77 68 61 74 ).<br>..But what
2520: 27 73 20 72 65 61 6c 6c 79 20 62 61 64 20 69 73 's really bad is
2530: 20 74 68 61 74 20 69 74 27 73 20 73 6c 6f 77 20 that it's slow
2540: 65 76 65 6e 20 77 68 65 6e 20 64 65 63 6f 6d 70 even when decomp
2550: 72 65 73 73 69 6e 67 20 28 61 62 6f 75 74 20 35 ressing (about 5
2560: 20 74 69 6d 65 73 20 73 6c 6f 77 65 72 20 74 68 times slower th
2570: 61 6e 20 44 45 46 4c 41 54 45 29 2e 3c 2f 6c 69 an DEFLATE).</li
2580: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 3c 62 >..</ul>..<br><b
2590: 72 3e 0d 0a 3c 68 33 3e 74 65 73 74 20 23 32 20 r>..<h3>test #2
25a0: 2d 20 63 6f 6d 70 72 65 73 73 69 6e 67 20 61 20 - compressing a
25b0: 53 51 4c 69 74 65 20 64 61 74 61 62 61 73 65 20 SQLite database
25c0: 66 69 6c 65 3c 2f 68 33 3e 0d 0a 3c 74 61 62 6c file</h3>..<tabl
25d0: 65 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 36 e cellspacing="6
25e0: 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 38 " cellpadding="8
25f0: 22 20 62 6f 72 64 65 72 3d 22 31 22 20 62 67 63 " border="1" bgc
2600: 6f 6c 6f 72 3d 22 23 66 66 66 66 65 30 22 3e 0d olor="#ffffe0">.
2610: 0a 3c 74 72 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 .<tr><th bgcolor
2620: 3d 22 23 64 30 66 66 39 30 22 3e 55 6e 63 6f 6d ="#d0ff90">Uncom
2630: 70 72 65 73 73 65 64 20 53 69 7a 65 3c 2f 74 68 pressed Size</th
2640: 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 64 ><th bgcolor="#d
2650: 30 66 66 39 30 22 3e 41 6c 67 6f 72 69 74 68 6d 0ff90">Algorithm
2660: 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 </th><th bgcolor
2670: 3d 22 23 64 30 66 66 39 30 22 3e 43 6f 6d 70 72 ="#d0ff90">Compr
2680: 65 73 73 65 64 20 53 69 7a 65 3c 2f 74 68 3e 0d essed Size</th>.
2690: 0a 09 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 ..<th bgcolor="#
26a0: 64 30 66 66 39 30 22 3e 43 6f 6d 70 72 65 73 73 d0ff90">Compress
26b0: 69 6f 6e 20 52 61 74 69 6f 3c 2f 74 68 3e 3c 74 ion Ratio</th><t
26c0: 68 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 h bgcolor="#d0ff
26d0: 39 30 22 3e 43 6f 6d 70 72 65 73 73 69 6f 6e 20 90">Compression
26e0: 54 69 6d 65 3c 2f 74 68 3e 3c 74 68 20 62 67 63 Time</th><th bgc
26f0: 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 44 olor="#d0ff90">D
2700: 65 63 6f 6d 70 72 65 73 73 69 6f 6e 20 54 69 6d ecompression Tim
2710: 65 3c 2f 74 68 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 e</th></tr>..<tr
2720: 3e 0d 0a 09 3c 74 68 20 72 6f 77 73 70 61 6e 3d >...<th rowspan=
2730: 22 34 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 "4" align="cente
2740: 72 22 3e 31 2e 31 33 20 47 42 3c 2f 74 64 3e 0d r">1.13 GB</td>.
2750: 0a 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e ..<td align="cen
2760: 74 65 72 22 3e 4c 5a 34 3c 2f 74 64 3e 3c 74 64 ter">LZ4</td><td
2770: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
2780: 30 38 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 61 6c 08 MB</td><td al
2790: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 32 2e 32 ign="center">2.2
27a0: 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 9</td><td align=
27b0: 22 72 69 67 68 74 22 3e 31 30 2e 33 33 33 20 73 "right">10.333 s
27c0: 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e ec</td><td align
27d0: 3d 22 72 69 67 68 74 22 3e 32 2e 31 32 33 20 73 ="right">2.123 s
27e0: 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a ec</td>..</tr>..
27f0: 3c 74 72 20 62 67 63 6f 6c 6f 72 3d 22 23 64 66 <tr bgcolor="#df
2800: 64 64 63 30 22 3e 0d 0a 09 3c 74 64 20 61 6c 69 ddc0">...<td ali
2810: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 44 45 46 4c gn="center">DEFL
2820: 41 54 45 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ATE</td><td alig
2830: 6e 3d 22 72 69 67 68 74 22 3e 33 32 33 20 4d 42 n="right">323 MB
2840: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
2850: 63 65 6e 74 65 72 22 3e 33 2e 36 30 3c 2f 74 64 center">3.60</td
2860: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
2870: 74 22 3e 35 34 2e 33 34 33 20 73 65 63 3c 2f 74 t">54.343 sec</t
2880: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
2890: 68 74 22 3e 33 2e 31 37 33 20 73 65 63 3c 2f 74 ht">3.173 sec</t
28a0: 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 0d d>..</tr>..<tr>.
28b0: 0a 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e ..<td align="cen
28c0: 74 65 72 22 3e 5a 53 54 44 3c 2f 74 64 3e 3c 74 ter">ZSTD</td><t
28d0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
28e0: 32 31 39 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 61 219 MB</td><td a
28f0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 35 2e lign="center">5.
2900: 33 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 31</td><td align
2910: 3d 22 72 69 67 68 74 22 3e 34 2e 33 33 31 20 73 ="right">4.331 s
2920: 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e ec</td><td align
2930: 3d 22 72 69 67 68 74 22 3e 31 2e 35 32 32 20 73 ="right">1.522 s
2940: 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a ec</td>..</tr>..
2950: 3c 74 72 20 62 67 63 6f 6c 6f 72 3d 22 23 64 66 <tr bgcolor="#df
2960: 64 64 63 30 22 3e 0d 0a 09 3c 74 64 20 61 6c 69 ddc0">...<td ali
2970: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4c 5a 4d 41 gn="center">LZMA
2980: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
2990: 72 69 67 68 74 22 3e 38 32 20 4d 42 3c 2f 74 64 right">82 MB</td
29a0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
29b0: 65 72 22 3e 31 34 2e 32 36 3c 2f 74 64 3e 3c 74 er">14.26</td><t
29c0: 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e d align="right">
29d0: 36 34 36 2e 36 37 30 20 73 65 63 3c 2f 74 64 3e 646.670 sec</td>
29e0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
29f0: 22 3e 31 37 2e 39 33 30 20 73 65 63 3c 2f 74 64 ">17.930 sec</td
2a00: 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c >..</tr>..</tabl
2a10: 65 3e 0d 0a 3c 62 3e 51 75 69 63 6b 20 61 73 73 e>..<b>Quick ass
2a20: 65 73 73 6d 65 6e 74 3a 3c 2f 62 3e 0d 0a 3c 75 essment:</b>..<u
2a30: 6c 3e 0d 0a 3c 6c 69 3e 54 68 65 20 73 61 6d 70 l>..<li>The samp
2a40: 6c 65 20 77 61 73 20 61 20 53 51 4c 69 74 65 2f le was a SQLite/
2a50: 53 70 61 74 69 61 4c 69 74 65 20 64 61 74 61 62 SpatiaLite datab
2a60: 61 73 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 ase containing t
2a70: 68 65 20 73 61 6d 65 20 47 54 46 53 3c 2f 61 3e he same GTFS</a>
2a80: 20 64 61 74 61 73 65 74 20 75 73 65 64 20 69 6e dataset used in
2a90: 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 74 65 the previous te
2aa0: 73 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 44 61 st.</li>..<li>Da
2ab0: 74 61 62 61 73 65 73 20 61 72 65 20 75 73 75 61 tabases are usua
2ac0: 6c 6c 79 20 65 78 70 65 63 74 65 64 20 74 6f 20 lly expected to
2ad0: 62 65 20 73 74 72 6f 6e 67 6c 79 20 63 6f 6d 70 be strongly comp
2ae0: 72 65 73 73 69 62 6c 65 20 28 73 6f 20 6d 61 6e ressible (so man
2af0: 79 20 72 65 70 65 74 69 74 69 6f 6e 73 20 6f 66 y repetitions of
2b00: 20 5a 45 52 4f 2c 20 53 50 41 43 45 20 61 6e 64 ZERO, SPACE and
2b10: 20 4e 55 4c 4c 20 76 61 6c 75 65 73 29 2c 20 61 NULL values), a
2b20: 6e 64 20 74 68 69 73 20 74 65 73 74 20 63 6f 6e nd this test con
2b30: 66 69 72 6d 73 20 74 68 65 20 65 78 70 65 63 74 firms the expect
2b40: 61 74 69 6f 6e 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c ations.</li>..<l
2b50: 69 3e 3c 62 3e 4c 5a 34 3c 2f 62 3e 20 63 6f 6e i><b>LZ4</b> con
2b60: 66 69 72 6d 73 20 74 6f 20 62 65 20 76 65 72 79 firms to be very
2b70: 20 66 61 73 74 20 62 75 74 20 6e 6f 74 20 76 65 fast but not ve
2b80: 72 79 20 65 66 66 65 63 74 69 76 65 2e 3c 2f 6c ry effective.</l
2b90: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 44 45 46 4c 41 i>..<li><b>DEFLA
2ba0: 54 45 3c 2f 62 3e 20 63 6f 6e 66 69 72 6d 73 20 TE</b> confirms
2bb0: 74 6f 20 62 65 20 73 74 69 6c 6c 20 76 61 6c 69 to be still vali
2bc0: 64 20 64 65 73 70 69 74 65 20 69 74 73 20 76 65 d despite its ve
2bd0: 6e 65 72 61 62 6c 65 20 61 67 65 2e 3c 2f 6c 69 nerable age.</li
2be0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 5a 53 54 44 3c 2f >..<li><b>ZSTD</
2bf0: 62 3e 20 69 73 20 6f 6e 63 65 20 6d 6f 72 65 20 b> is once more
2c00: 74 68 65 20 77 69 6e 6e 65 72 20 6f 66 20 74 68 the winner of th
2c10: 69 73 20 74 65 73 74 2c 20 62 65 69 6e 67 20 62 is test, being b
2c20: 6f 74 68 20 66 61 73 74 20 61 6e 64 20 65 66 66 oth fast and eff
2c30: 65 63 74 69 76 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c ective.</li>..<l
2c40: 69 3e 3c 62 3e 4c 5a 4d 41 3c 2f 62 3e 20 63 6f i><b>LZMA</b> co
2c50: 6e 66 69 72 6d 73 20 74 6f 20 62 65 20 75 6e 62 nfirms to be unb
2c60: 65 61 74 61 62 6c 65 20 66 6f 72 20 72 65 61 63 eatable for reac
2c70: 68 69 6e 67 20 76 65 72 79 20 68 69 67 68 20 63 hing very high c
2c80: 6f 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 69 6f ompression ratio
2c90: 73 2c 20 62 75 74 20 75 6e 68 61 70 70 69 6c 79 s, but unhappily
2ca0: 20 69 74 20 63 6f 6e 66 69 72 6d 73 20 69 74 73 it confirms its
2cb0: 20 62 61 72 65 6c 79 20 74 6f 6c 65 72 61 62 6c barely tolerabl
2cc0: 65 20 73 6c 6f 77 6e 65 73 73 2e 3c 2f 6c 69 3e e slowness.</li>
2cd0: 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 3c 62 72 ..</ul>..<br><br
2ce0: 3e 0d 0a 3c 68 33 3e 74 65 73 74 20 23 33 20 2d >..<h3>test #3 -
2cf0: 20 63 6f 6d 70 72 65 73 73 69 6e 67 20 6d 61 6e compressing man
2d00: 79 20 53 68 61 70 65 66 69 6c 65 73 3c 2f 68 33 y Shapefiles</h3
2d10: 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 >..<table cellsp
2d20: 61 63 69 6e 67 3d 22 36 22 20 63 65 6c 6c 70 61 acing="6" cellpa
2d30: 64 64 69 6e 67 3d 22 38 22 20 62 6f 72 64 65 72 dding="8" border
2d40: 3d 22 31 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 ="1" bgcolor="#f
2d50: 66 66 66 65 30 22 3e 0d 0a 3c 74 72 3e 3c 74 68 fffe0">..<tr><th
2d60: 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 bgcolor="#d0ff9
2d70: 30 22 3e 55 6e 63 6f 6d 70 72 65 73 73 65 64 20 0">Uncompressed
2d80: 53 69 7a 65 3c 2f 74 68 3e 3c 74 68 20 62 67 63 Size</th><th bgc
2d90: 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 41 olor="#d0ff90">A
2da0: 6c 67 6f 72 69 74 68 6d 3c 2f 74 68 3e 3c 74 68 lgorithm</th><th
2db0: 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 bgcolor="#d0ff9
2dc0: 30 22 3e 43 6f 6d 70 72 65 73 73 65 64 20 53 69 0">Compressed Si
2dd0: 7a 65 3c 2f 74 68 3e 0d 0a 09 3c 74 68 20 62 67 ze</th>...<th bg
2de0: 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 3e color="#d0ff90">
2df0: 43 6f 6d 70 72 65 73 73 69 6f 6e 20 52 61 74 69 Compression Rati
2e00: 6f 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f o</th><th bgcolo
2e10: 72 3d 22 23 64 30 66 66 39 30 22 3e 43 6f 6d 70 r="#d0ff90">Comp
2e20: 72 65 73 73 69 6f 6e 20 54 69 6d 65 3c 2f 74 68 ression Time</th
2e30: 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 64 ><th bgcolor="#d
2e40: 30 66 66 39 30 22 3e 44 65 63 6f 6d 70 72 65 73 0ff90">Decompres
2e50: 73 69 6f 6e 20 54 69 6d 65 3c 2f 74 68 3e 3c 2f sion Time</th></
2e60: 74 72 3e 0d 0a 3c 74 72 3e 0d 0a 09 3c 74 68 20 tr>..<tr>...<th
2e70: 72 6f 77 73 70 61 6e 3d 22 34 22 20 61 6c 69 67 rowspan="4" alig
2e80: 6e 3d 22 63 65 6e 74 65 72 22 3e 31 2e 31 39 20 n="center">1.19
2e90: 47 42 3c 2f 74 64 3e 0d 0a 09 3c 74 64 20 61 6c GB</td>...<td al
2ea0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 4c 5a 34 ign="center">LZ4
2eb0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
2ec0: 72 69 67 68 74 22 3e 30 2e 39 39 20 47 42 3c 2f right">0.99 GB</
2ed0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
2ee0: 6e 74 65 72 22 3e 31 2e 32 30 3c 2f 74 64 3e 3c nter">1.20</td><
2ef0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2f00: 3e 36 2e 34 31 33 20 73 65 63 3c 2f 74 64 3e 3c >6.413 sec</td><
2f10: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2f20: 3e 30 2e 38 39 33 20 73 65 63 3c 2f 74 64 3e 0d >0.893 sec</td>.
2f30: 0a 3c 2f 74 72 3e 0d 0a 3c 74 72 20 62 67 63 6f .</tr>..<tr bgco
2f40: 6c 6f 72 3d 22 23 64 66 64 64 63 30 22 3e 0d 0a lor="#dfddc0">..
2f50: 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 .<td align="cent
2f60: 65 72 22 3e 44 45 46 4c 41 54 45 3c 2f 74 64 3e er">DEFLATE</td>
2f70: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
2f80: 22 3e 38 37 30 20 4d 42 3c 2f 74 64 3e 3c 74 64 ">870 MB</td><td
2f90: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
2fa0: 31 2e 34 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 1.40</td><td ali
2fb0: 67 6e 3d 22 72 69 67 68 74 22 3e 34 38 2e 30 30 gn="right">48.00
2fc0: 34 20 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 4 sec</td><td al
2fd0: 69 67 6e 3d 22 72 69 67 68 74 22 3e 34 2e 35 35 ign="right">4.55
2fe0: 33 20 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3 sec</td>..</tr
2ff0: 3e 0d 0a 3c 74 72 3e 0d 0a 09 3c 74 64 20 61 6c >..<tr>...<td al
3000: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 5a 53 54 ign="center">ZST
3010: 44 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d D</td><td align=
3020: 22 72 69 67 68 74 22 3e 38 38 30 20 4d 42 3c 2f "right">880 MB</
3030: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
3040: 6e 74 65 72 22 3e 31 2e 33 39 3c 2f 74 64 3e 3c nter">1.39</td><
3050: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3060: 3e 35 2e 34 31 36 20 73 65 63 3c 2f 74 64 3e 3c >5.416 sec</td><
3070: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
3080: 3e 31 2e 32 39 32 20 73 65 63 3c 2f 74 64 3e 0d >1.292 sec</td>.
3090: 0a 3c 2f 74 72 3e 0d 0a 3c 74 72 20 62 67 63 6f .</tr>..<tr bgco
30a0: 6c 6f 72 3d 22 23 64 66 64 64 63 30 22 3e 0d 0a lor="#dfddc0">..
30b0: 09 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 .<td align="cent
30c0: 65 72 22 3e 4c 5a 4d 41 3c 2f 74 64 3e 3c 74 64 er">LZMA</td><td
30d0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 36 align="right">6
30e0: 38 32 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 61 6c 82 MB</td><td al
30f0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 2e 37 ign="center">1.7
3100: 39 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 9</td><td align=
3110: 22 72 69 67 68 74 22 3e 37 34 30 2e 30 37 37 20 "right">740.077
3120: 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 sec</td><td alig
3130: 6e 3d 22 72 69 67 68 74 22 3e 34 35 2e 36 32 34 n="right">45.624
3140: 20 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e sec</td>..</tr>
3150: 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 3e 51 ..</table>..<b>Q
3160: 75 69 63 6b 20 61 73 73 65 73 73 6d 65 6e 74 3a uick assessment:
3170: 3c 2f 62 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e </b>..<ul>..<li>
3180: 54 68 65 20 73 61 6d 70 6c 65 20 77 61 73 20 61 The sample was a
3190: 20 74 61 72 62 61 6c 6c 20 63 6f 6e 74 61 69 6e tarball contain
31a0: 69 6e 67 20 73 65 76 65 72 61 6c 20 53 68 61 70 ing several Shap
31b0: 65 66 69 6c 65 73 20 28 52 6f 61 64 20 4e 65 74 efiles (Road Net
31c0: 77 6f 72 6b 20 61 6e 64 20 41 64 6d 69 6e 69 73 work and Adminis
31d0: 74 72 61 74 69 76 65 20 42 6f 75 6e 64 61 72 69 trative Boundari
31e0: 65 73 20 6f 66 20 54 75 73 63 61 6e 79 29 2e 3c es of Tuscany).<
31f0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 68 61 70 65 66 /li>..<li>Shapef
3200: 69 6c 65 73 20 63 6f 6e 74 61 69 6e 20 70 6c 65 iles contain ple
3210: 6e 74 79 20 6f 66 20 72 61 77 20 62 69 6e 61 72 nty of raw binar
3220: 79 20 64 61 74 61 2c 20 61 6e 64 20 63 6f 6e 73 y data, and cons
3230: 65 71 75 65 6e 74 6c 79 20 61 72 65 20 72 61 74 equently are rat
3240: 68 65 72 20 68 61 72 64 20 74 6f 20 62 65 20 73 her hard to be s
3250: 74 72 6f 6e 67 6c 79 20 63 6f 6d 70 72 65 73 73 trongly compress
3260: 65 64 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 66 75 ed.<br>..This fu
3270: 6c 6c 79 20 65 78 70 6c 61 69 6e 73 20 77 68 79 lly explains why
3280: 20 69 6e 20 74 68 69 73 20 73 70 65 63 69 66 69 in this specifi
3290: 63 20 74 65 73 74 20 74 68 65 20 63 6f 6d 70 72 c test the compr
32a0: 65 73 73 69 6f 6e 20 72 61 74 69 6f 73 20 61 72 ession ratios ar
32b0: 65 20 61 6c 77 61 79 73 20 76 65 72 79 20 62 6c e always very bl
32c0: 61 6e 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c and.</li>..<li><
32d0: 62 3e 4c 5a 34 3c 2f 62 3e 20 63 6f 6e 66 69 72 b>LZ4</b> confir
32e0: 6d 73 20 74 6f 20 62 65 20 76 65 72 79 20 66 61 ms to be very fa
32f0: 73 74 20 62 75 74 20 6e 6f 74 20 76 65 72 79 20 st but not very
3300: 65 66 66 65 63 74 69 76 65 2e 3c 2f 6c 69 3e 0d effective.</li>.
3310: 0a 3c 6c 69 3e 3c 62 3e 44 45 46 4c 41 54 45 3c .<li><b>DEFLATE<
3320: 2f 62 3e 20 63 6f 6e 66 69 72 6d 73 20 74 6f 20 /b> confirms to
3330: 62 65 20 73 74 69 6c 6c 20 76 61 6c 69 64 20 64 be still valid d
3340: 65 73 70 69 74 65 20 69 74 73 20 76 65 6e 65 72 espite its vener
3350: 61 62 6c 65 20 61 67 65 2e 3c 2f 6c 69 3e 0d 0a able age.</li>..
3360: 3c 6c 69 3e 3c 62 3e 5a 53 54 44 3c 2f 62 3e 20 <li><b>ZSTD</b>
3370: 69 73 20 6f 6e 63 65 20 6d 6f 72 65 20 74 68 65 is once more the
3380: 20 77 69 6e 6e 65 72 20 6f 66 20 74 68 69 73 20 winner of this
3390: 74 65 73 74 2c 20 62 65 69 6e 67 20 6e 6f 74 69 test, being noti
33a0: 63 65 61 62 6c 79 20 66 61 73 74 65 72 20 74 68 ceably faster th
33b0: 61 6e 20 44 45 46 4c 41 54 45 2e 3c 62 72 3e 0d an DEFLATE.<br>.
33c0: 0a 42 75 74 20 69 74 27 73 20 77 6f 72 74 68 20 .But it's worth
33d0: 6e 6f 74 69 6e 67 20 74 68 61 74 20 69 6e 20 74 noting that in t
33e0: 68 69 73 20 73 70 65 63 69 66 69 63 20 74 65 73 his specific tes
33f0: 74 20 69 74 27 73 20 75 6e 61 62 6c 65 20 74 6f t it's unable to
3400: 20 72 65 61 63 68 20 61 20 62 65 74 74 65 72 20 reach a better
3410: 63 6f 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 69 compression rati
3420: 6f 20 74 68 61 6e 20 44 45 46 4c 41 54 45 2e 3c o than DEFLATE.<
3430: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4c 5a 4d /li>..<li><b>LZM
3440: 41 3c 2f 62 3e 20 63 6f 6e 66 69 72 6d 73 20 74 A</b> confirms t
3450: 6f 20 62 65 20 75 6e 62 65 61 74 61 62 6c 65 20 o be unbeatable
3460: 66 6f 72 20 72 65 61 63 68 69 6e 67 20 76 65 72 for reaching ver
3470: 79 20 68 69 67 68 20 63 6f 6d 70 72 65 73 73 69 y high compressi
3480: 6f 6e 20 72 61 74 69 6f 73 2c 20 62 75 74 20 75 on ratios, but u
3490: 6e 68 61 70 70 69 6c 79 20 69 74 20 63 6f 6e 66 nhappily it conf
34a0: 69 72 6d 73 20 69 74 73 20 62 61 72 65 6c 79 20 irms its barely
34b0: 74 6f 6c 65 72 61 62 6c 65 20 73 6c 6f 77 6e 65 tolerable slowne
34c0: 73 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d ss.</li>..</ul>.
34d0: 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 33 3e 74 .<br><br>..<h3>t
34e0: 65 73 74 20 23 34 20 2d 20 63 6f 6d 70 72 65 73 est #4 - compres
34f0: 73 69 6e 67 20 61 20 4c 61 6e 64 73 61 74 20 38 sing a Landsat 8
3500: 20 73 63 65 6e 65 20 28 73 61 74 65 6c 6c 69 74 scene (satellit
3510: 65 20 69 6d 61 67 65 72 79 29 3c 2f 68 33 3e 0d e imagery)</h3>.
3520: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 63 .<table cellspac
3530: 69 6e 67 3d 22 36 22 20 63 65 6c 6c 70 61 64 64 ing="6" cellpadd
3540: 69 6e 67 3d 22 38 22 20 62 6f 72 64 65 72 3d 22 ing="8" border="
3550: 31 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 66 66 1" bgcolor="#fff
3560: 66 65 30 22 3e 0d 0a 3c 74 72 3e 3c 74 68 20 62 fe0">..<tr><th b
3570: 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 gcolor="#d0ff90"
3580: 3e 55 6e 63 6f 6d 70 72 65 73 73 65 64 20 53 69 >Uncompressed Si
3590: 7a 65 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c ze</th><th bgcol
35a0: 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 41 6c 67 or="#d0ff90">Alg
35b0: 6f 72 69 74 68 6d 3c 2f 74 68 3e 3c 74 68 20 62 orithm</th><th b
35c0: 67 63 6f 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 gcolor="#d0ff90"
35d0: 3e 43 6f 6d 70 72 65 73 73 65 64 20 53 69 7a 65 >Compressed Size
35e0: 3c 2f 74 68 3e 0d 0a 09 3c 74 68 20 62 67 63 6f </th>...<th bgco
35f0: 6c 6f 72 3d 22 23 64 30 66 66 39 30 22 3e 43 6f lor="#d0ff90">Co
3600: 6d 70 72 65 73 73 69 6f 6e 20 52 61 74 69 6f 3c mpression Ratio<
3610: 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d /th><th bgcolor=
3620: 22 23 64 30 66 66 39 30 22 3e 43 6f 6d 70 72 65 "#d0ff90">Compre
3630: 73 73 69 6f 6e 20 54 69 6d 65 3c 2f 74 68 3e 3c ssion Time</th><
3640: 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 66 th bgcolor="#d0f
3650: 66 39 30 22 3e 44 65 63 6f 6d 70 72 65 73 73 69 f90">Decompressi
3660: 6f 6e 20 54 69 6d 65 3c 2f 74 68 3e 3c 2f 74 72 on Time</th></tr
3670: 3e 3c 74 72 3e 0d 0a 09 3c 74 68 20 72 6f 77 73 ><tr>...<th rows
3680: 70 61 6e 3d 22 34 22 20 61 6c 69 67 6e 3d 22 63 pan="4" align="c
3690: 65 6e 74 65 72 22 3e 31 2e 37 38 20 47 42 3c 2f enter">1.78 GB</
36a0: 74 64 3e 0d 0a 09 3c 74 64 20 61 6c 69 67 6e 3d td>...<td align=
36b0: 22 63 65 6e 74 65 72 22 3e 4c 5a 34 3c 2f 74 64 "center">LZ4</td
36c0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 ><td align="righ
36d0: 74 22 3e 31 2e 30 37 20 47 42 3c 2f 74 64 3e 3c t">1.07 GB</td><
36e0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
36f0: 22 3e 31 2e 36 35 3c 2f 74 64 3e 3c 74 64 20 61 ">1.65</td><td a
3700: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 2e 31 lign="right">5.1
3710: 30 34 20 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 04 sec</td><td a
3720: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 2e 32 lign="right">1.2
3730: 38 35 20 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 85 sec</td>..</t
3740: 72 3e 0d 0a 3c 74 72 20 62 67 63 6f 6c 6f 72 3d r>..<tr bgcolor=
3750: 22 23 64 66 64 64 63 30 22 3e 0d 0a 09 3c 74 64 "#dfddc0">...<td
3760: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
3770: 44 45 46 4c 41 54 45 3c 2f 74 64 3e 3c 74 64 20 DEFLATE</td><td
3780: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 39 32 align="right">92
3790: 38 20 4d 42 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 8 MB</td><td ali
37a0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 2e 39 37 gn="center">1.97
37b0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
37c0: 72 69 67 68 74 22 3e 35 36 2e 36 34 33 20 73 65 right">56.643 se
37d0: 63 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d c</td><td align=
37e0: 22 72 69 67 68 74 22 3e 37 2e 31 37 36 20 73 65 "right">7.176 se
37f0: 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c c</td>..</tr>..<
3800: 74 72 3e 0d 0a 09 3c 74 64 20 61 6c 69 67 6e 3d tr>...<td align=
3810: 22 63 65 6e 74 65 72 22 3e 5a 53 54 44 3c 2f 74 "center">ZSTD</t
3820: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3830: 68 74 22 3e 39 32 39 20 4d 42 3c 2f 74 64 3e 3c ht">929 MB</td><
3840: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
3850: 22 3e 31 2e 39 36 3c 2f 74 64 3e 3c 74 64 20 61 ">1.96</td><td a
3860: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 37 2e 32 lign="right">7.2
3870: 36 31 20 73 65 63 3c 2f 74 64 3e 3c 74 64 20 61 61 sec</td><td a
3880: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 32 2e 33 lign="right">2.3
3890: 32 39 20 73 65 63 3c 2f 74 64 3e 0d 0a 3c 2f 74 29 sec</td>..</t
38a0: 72 3e 0d 0a 3c 74 72 20 62 67 63 6f 6c 6f 72 3d r>..<tr bgcolor=
38b0: 22 23 64 66 64 64 63 30 22 3e 0d 0a 09 3c 74 64 "#dfddc0">...<td
38c0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
38d0: 4c 5a 4d 41 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 LZMA</td><td ali
38e0: 67 6e 3d 22 72 69 67 68 74 22 3e 37 39 38 20 4d gn="right">798 M
38f0: 42 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d B</td><td align=
3900: 22 63 65 6e 74 65 72 22 3e 32 2e 32 39 3c 2f 74 "center">2.29</t
3910: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
3920: 68 74 22 3e 39 35 37 2e 31 38 32 20 73 65 63 3c ht">957.182 sec<
3930: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
3940: 69 67 68 74 22 3e 39 35 2e 32 38 38 20 73 65 63 ight">95.288 sec
3950: 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 2f </td>..</tr>..</
3960: 74 61 62 6c 65 3e 0d 0a 3c 62 3e 51 75 69 63 6b table>..<b>Quick
3970: 20 61 73 73 65 73 73 6d 65 6e 74 3a 3c 2f 62 3e assessment:</b>
3980: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 54 68 65 20 ..<ul>..<li>The
3990: 73 61 6d 70 6c 65 20 77 61 73 20 61 20 74 61 72 sample was a tar
39a0: 62 61 6c 6c 20 63 6f 6e 74 61 69 6e 69 6e 67 20 ball containing
39b0: 61 20 4c 61 6e 64 73 61 74 20 38 20 73 63 65 6e a Landsat 8 scen
39c0: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 53 61 74 e.</li>..<li>Sat
39d0: 65 6c 6c 69 74 65 20 69 6d 61 67 65 72 79 20 63 ellite imagery c
39e0: 6f 6e 74 61 69 6e 20 70 6c 65 6e 74 79 20 6f 66 ontain plenty of
39f0: 20 72 61 77 20 62 69 6e 61 72 79 20 64 61 74 61 raw binary data
3a00: 2c 20 61 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74 , and consequent
3a10: 6c 79 20 61 72 65 20 72 61 74 68 65 72 20 68 61 ly are rather ha
3a20: 72 64 20 74 6f 20 62 65 20 73 74 72 6f 6e 67 6c rd to be strongl
3a30: 79 20 63 6f 6d 70 72 65 73 73 65 64 2e 3c 62 72 y compressed.<br
3a40: 3e 0d 0a 54 68 69 73 20 66 75 6c 6c 79 20 65 78 >..This fully ex
3a50: 70 6c 61 69 6e 73 20 77 68 79 20 69 6e 20 74 68 plains why in th
3a60: 69 73 20 73 70 65 63 69 66 69 63 20 74 65 73 74 is specific test
3a70: 20 74 68 65 20 63 6f 6d 70 72 65 73 73 69 6f 6e the compression
3a80: 20 72 61 74 69 6f 73 20 61 72 65 20 61 6c 77 61 ratios are alwa
3a90: 79 73 20 76 65 72 79 20 62 6c 61 6e 64 2e 3c 2f ys very bland.</
3aa0: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4c 5a 34 3c li>..<li><b>LZ4<
3ab0: 2f 62 3e 20 63 6f 6e 66 69 72 6d 73 20 74 6f 20 /b> confirms to
3ac0: 62 65 20 76 65 72 79 20 66 61 73 74 20 62 75 74 be very fast but
3ad0: 20 6e 6f 74 20 76 65 72 79 20 65 66 66 65 63 74 not very effect
3ae0: 69 76 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ive.</li>..<li><
3af0: 62 3e 44 45 46 4c 41 54 45 3c 2f 62 3e 20 63 6f b>DEFLATE</b> co
3b00: 6e 66 69 72 6d 73 20 74 6f 20 62 65 20 73 74 69 nfirms to be sti
3b10: 6c 6c 20 76 61 6c 69 64 20 64 65 73 70 69 74 65 ll valid despite
3b20: 20 69 74 73 20 76 65 6e 65 72 61 62 6c 65 20 61 its venerable a
3b30: 67 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 ge.</li>..<li><b
3b40: 3e 5a 53 54 44 3c 2f 62 3e 20 69 73 20 6f 6e 63 >ZSTD</b> is onc
3b50: 65 20 6d 6f 72 65 20 74 68 65 20 77 69 6e 6e 65 e more the winne
3b60: 72 20 6f 66 20 74 68 69 73 20 74 65 73 74 2c 20 r of this test,
3b70: 62 65 69 6e 67 20 6e 6f 74 69 63 65 61 62 6c 79 being noticeably
3b80: 20 66 61 73 74 65 72 20 74 68 61 6e 20 44 45 46 faster than DEF
3b90: 4c 41 54 45 2e 3c 62 72 3e 0d 0a 42 75 74 20 69 LATE.<br>..But i
3ba0: 74 27 73 20 77 6f 72 74 68 20 6e 6f 74 69 6e 67 t's worth noting
3bb0: 20 74 68 61 74 20 69 6e 20 74 68 69 73 20 73 70 that in this sp
3bc0: 65 63 69 66 69 63 20 74 65 73 74 20 69 74 27 73 ecific test it's
3bd0: 20 75 6e 61 62 6c 65 20 74 6f 20 72 65 61 63 68 unable to reach
3be0: 20 61 20 62 65 74 74 65 72 20 63 6f 6d 70 72 65 a better compre
3bf0: 73 73 69 6f 6e 20 72 61 74 69 6f 20 74 68 61 6e ssion ratio than
3c00: 20 44 45 46 4c 41 54 45 2e 3c 2f 6c 69 3e 0d 0a DEFLATE.</li>..
3c10: 3c 6c 69 3e 3c 62 3e 4c 5a 4d 41 3c 2f 62 3e 20 <li><b>LZMA</b>
3c20: 63 6f 6e 66 69 72 6d 73 20 74 6f 20 62 65 20 75 confirms to be u
3c30: 6e 62 65 61 74 61 62 6c 65 20 66 6f 72 20 72 65 nbeatable for re
3c40: 61 63 68 69 6e 67 20 76 65 72 79 20 68 69 67 68 aching very high
3c50: 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 compression rat
3c60: 69 6f 73 2c 20 62 75 74 20 75 6e 68 61 70 70 69 ios, but unhappi
3c70: 6c 79 20 69 74 20 63 6f 6e 66 69 72 6d 73 20 69 ly it confirms i
3c80: 74 73 20 62 61 72 65 6c 79 20 74 6f 6c 65 72 61 ts barely tolera
3c90: 62 6c 65 20 73 6c 6f 77 6e 65 73 73 2e 3c 2f 6c ble slowness.</l
3ca0: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 3c i>..</ul>..<br><
3cb0: 62 72 3e 0d 0a 3c 62 3e 46 69 6e 61 6c 20 61 73 br>..<b>Final as
3cc0: 73 65 73 73 6d 65 6e 74 20 28 61 6e 64 20 6c 65 sessment (and le
3cd0: 73 73 6f 6e 73 20 6c 65 61 72 6e 65 64 29 3c 2f ssons learned)</
3ce0: 62 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 54 68 b>..<ul>..<li>Th
3cf0: 65 20 69 6e 74 72 69 6e 73 69 63 20 65 66 66 69 e intrinsic effi
3d00: 63 69 65 6e 63 79 20 6f 66 20 61 6c 6c 20 6c 6f ciency of all lo
3d10: 73 73 6c 65 73 73 20 63 6f 6d 70 72 65 73 73 69 ssless compressi
3d20: 6f 6e 20 61 6c 67 6f 72 69 74 68 6d 20 73 74 72 on algorithm str
3d30: 6f 6e 67 6c 79 20 64 65 70 65 6e 64 73 20 6f 6e ongly depends on
3d40: 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 64 61 the internal da
3d50: 74 61 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 ta distribution
3d60: 77 69 74 68 69 6e 20 74 68 65 20 73 61 6d 70 6c within the sampl
3d70: 65 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 73 61 e...<ul>..<li>sa
3d80: 6d 70 6c 65 73 20 70 72 65 73 65 6e 74 69 6e 67 mples presenting
3d90: 20 61 20 76 65 72 79 20 72 65 67 75 6c 61 72 20 a very regular
3da0: 61 6e 64 20 65 61 73 69 6c 79 20 70 72 65 64 69 and easily predi
3db0: 63 74 61 62 6c 65 20 69 6e 74 65 72 6e 61 6c 20 ctable internal
3dc0: 64 69 73 74 72 69 62 75 74 69 6f 6e 20 68 61 76 distribution hav
3dd0: 65 20 61 20 3c 62 3e 6c 6f 77 20 69 6e 66 6f 72 e a <b>low infor
3de0: 6d 61 74 69 6f 6e 20 65 6e 74 72 6f 70 79 3c 2f mation entropy</
3df0: 62 3e 2c 20 61 6e 64 20 63 61 6e 20 62 65 20 73 b>, and can be s
3e00: 74 72 6f 6e 67 6c 79 20 63 6f 6d 70 72 65 73 73 trongly compress
3e10: 65 64 2e 3c 62 72 3e 0d 0a 41 20 74 79 70 69 63 ed.<br>..A typic
3e20: 61 6c 20 65 78 61 6d 70 6c 65 3a 20 74 65 78 74 al example: text
3e30: 20 66 69 6c 65 73 20 77 72 69 74 74 65 6e 20 69 files written i
3e40: 73 20 73 6f 6d 65 20 6c 61 6e 67 75 61 67 65 20 s some language
3e50: 62 61 73 65 64 20 6f 6e 20 74 68 65 20 4c 61 74 based on the Lat
3e60: 69 6e 20 61 6c 70 68 61 62 65 74 2e 3c 2f 6c 69 in alphabet.</li
3e70: 3e 0d 0a 3c 6c 69 3e 73 61 6d 70 6c 65 73 20 70 >..<li>samples p
3e80: 72 65 73 65 6e 74 69 6e 67 20 61 6e 20 69 72 72 resenting an irr
3e90: 65 67 75 6c 61 72 20 61 6e 64 20 72 61 6e 64 6f egular and rando
3ea0: 6d 20 69 6e 74 65 72 6e 61 6c 20 64 69 73 74 72 m internal distr
3eb0: 69 62 75 74 69 6f 6e 20 68 61 76 65 20 61 20 3c ibution have a <
3ec0: 62 3e 68 69 67 68 20 69 6e 66 6f 72 6d 61 74 69 b>high informati
3ed0: 6f 6e 20 65 6e 74 72 6f 70 79 3c 2f 62 3e 2c 20 on entropy</b>,
3ee0: 61 6e 64 20 63 61 6e 20 62 65 20 6f 6e 6c 79 20 and can be only
3ef0: 6d 6f 64 65 72 61 74 65 6c 79 20 63 6f 6d 70 72 moderately compr
3f00: 65 73 73 65 64 2e 3c 62 72 3e 0d 0a 41 20 74 79 essed.<br>..A ty
3f10: 70 69 63 61 6c 20 65 78 61 6d 70 6c 65 3a 20 61 pical example: a
3f20: 6e 79 20 6b 69 6e 64 20 6f 66 20 62 69 6e 61 72 ny kind of binar
3f30: 79 20 66 69 6c 65 2e 3c 62 72 3e 0d 0a 3c 62 3e y file.<br>..<b>
3f40: 4e 6f 74 65 3c 2f 62 3e 3a 20 61 6e 79 20 62 69 Note</b>: any bi
3f50: 6e 61 72 79 20 66 69 6c 65 20 70 72 65 73 65 6e nary file presen
3f60: 74 69 6e 67 20 61 20 70 65 72 66 65 63 74 6c 79 ting a perfectly
3f70: 20 72 61 6e 64 6f 6d 20 69 6e 74 65 72 6e 61 6c random internal
3f80: 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 distribution of
3f90: 20 76 61 6c 75 65 73 20 69 73 20 63 6f 6e 63 65 values is conce
3fa0: 70 74 75 61 6c 6c 79 20 69 6d 70 6f 73 73 69 62 ptually impossib
3fb0: 6c 65 20 74 6f 20 62 65 20 63 6f 6d 70 72 65 73 le to be compres
3fc0: 73 65 64 20 61 74 20 61 6c 6c 2e 3c 2f 6c 69 3e sed at all.</li>
3fd0: 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c ..</ul></li>..<l
3fe0: 69 3e 61 6e 79 20 6c 6f 73 73 6c 65 73 73 20 63 i>any lossless c
3ff0: 6f 6d 70 72 65 73 73 69 6f 6e 20 73 74 72 61 74 ompression strat
4000: 65 67 79 20 69 6d 70 6c 69 65 73 20 61 20 74 72 egy implies a tr
4010: 61 64 65 20 6f 66 66 20 62 65 74 77 65 65 6e 20 ade off between
4020: 73 70 65 65 64 20 61 6e 64 20 63 6f 6d 70 72 65 speed and compre
4030: 73 73 69 6f 6e 20 72 61 74 69 6f 3a 0d 0a 3c 75 ssion ratio:..<u
4040: 6c 3e 0d 0a 3c 6c 69 3e 79 6f 75 20 63 61 6e 20 l>..<li>you can
4050: 6f 70 74 69 6d 69 7a 65 20 66 6f 72 20 73 70 65 optimize for spe
4060: 65 64 2c 20 62 75 74 20 69 6e 20 74 68 69 73 20 ed, but in this
4070: 63 61 73 65 20 79 6f 75 20 61 72 65 20 6e 65 63 case you are nec
4080: 65 73 73 61 72 69 6c 79 20 73 61 63 72 69 66 69 essarily sacrifi
4090: 63 69 6e 67 20 74 68 65 20 63 6f 6d 70 72 65 73 cing the compres
40a0: 73 69 6f 6e 20 72 61 74 69 6f 2e 3c 62 72 3e 0d sion ratio.<br>.
40b0: 0a 28 74 68 69 73 20 69 73 20 74 68 65 20 63 68 .(this is the ch
40c0: 6f 69 63 65 20 61 64 6f 70 74 65 64 20 62 79 20 oice adopted by
40d0: 4c 5a 34 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e LZ4).</li>..<li>
40e0: 61 74 20 74 68 65 20 6f 70 70 6f 73 69 74 65 20 at the opposite
40f0: 73 69 64 65 20 6f 66 20 74 68 65 20 73 70 65 63 side of the spec
4100: 74 72 75 6d 20 79 6f 75 20 63 61 6e 20 6f 70 74 trum you can opt
4110: 69 6d 69 7a 65 20 66 6f 72 20 68 69 67 68 20 63 imize for high c
4120: 6f 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 69 6f ompression ratio
4130: 73 2c 20 62 75 74 20 69 6e 20 74 68 69 73 20 63 s, but in this c
4140: 61 73 65 20 79 6f 75 20 61 72 65 20 6e 65 63 65 ase you are nece
4150: 73 73 61 72 69 6c 79 20 73 61 63 72 69 66 69 63 ssarily sacrific
4160: 69 6e 67 20 73 70 65 65 64 2e 3c 62 72 3e 0d 0a ing speed.<br>..
4170: 28 74 68 69 73 20 69 73 20 74 68 65 20 63 68 6f (this is the cho
4180: 69 63 65 20 61 64 6f 70 74 65 64 20 62 79 20 4c ice adopted by L
4190: 5a 4d 41 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ZMA).</li>..<li>
41a0: 74 68 65 20 77 69 73 65 73 74 20 61 70 70 72 6f the wisest appro
41b0: 61 63 68 20 66 61 6c 6c 73 20 73 6f 6d 65 77 68 ach falls somewh
41c0: 65 72 65 20 69 6e 20 74 68 65 20 6d 69 64 64 6c ere in the middl
41d0: 65 3b 20 61 20 77 65 6c 6c 20 62 61 6c 61 6e 63 e; a well balanc
41e0: 65 64 20 6d 69 78 20 28 61 20 72 65 61 73 6f 6e ed mix (a reason
41f0: 61 62 6c 65 20 63 6f 6d 70 72 6f 6d 69 73 65 29 able compromise)
4200: 20 62 65 74 77 65 65 6e 20 73 70 65 65 64 20 61 between speed a
4210: 6e 64 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 72 nd compression r
4220: 61 74 69 6f 2e 3c 62 72 3e 0d 0a 28 74 68 69 73 atio.<br>..(this
4230: 20 69 73 20 74 68 65 20 63 68 6f 69 63 65 20 6f is the choice o
4240: 66 20 62 6f 74 68 20 44 45 46 4c 41 54 45 20 61 f both DEFLATE a
4250: 6e 64 20 5a 53 54 44 29 2e 3c 2f 6c 69 3e 0d 0a nd ZSTD).</li>..
4260: 3c 2f 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 76 </ul>..<li>the v
4270: 65 72 79 20 72 65 63 65 6e 74 6c 79 20 69 6e 74 ery recently int
4280: 72 6f 64 75 63 65 64 20 5a 53 54 44 20 63 6c 65 roduced ZSTD cle
4290: 61 72 6c 79 20 69 73 20 61 20 73 75 70 65 72 69 arly is a superi
42a0: 6f 72 20 61 6c 74 65 72 6e 61 74 69 76 65 20 74 or alternative t
42b0: 6f 20 74 68 65 20 6f 6c 64 20 44 45 46 4c 41 54 o the old DEFLAT
42c0: 45 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 5a 53 E:..<ul>..<li>ZS
42d0: 54 44 20 69 73 20 61 6c 77 61 79 73 20 6e 6f 74 TD is always not
42e0: 69 63 65 61 62 6c 79 20 66 61 73 74 65 72 20 74 iceably faster t
42f0: 68 61 6e 20 44 45 46 4c 41 54 45 2c 20 62 6f 74 han DEFLATE, bot
4300: 68 20 77 68 65 6e 20 63 6f 6d 70 72 65 73 73 69 h when compressi
4310: 6e 67 20 61 6e 64 20 64 65 63 6f 6d 70 72 65 73 ng and decompres
4320: 73 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e sing.</li>..<li>
4330: 5a 53 54 44 20 69 73 20 6e 6f 74 20 61 6c 77 61 ZSTD is not alwa
4340: 79 73 20 61 62 6c 65 20 74 6f 20 72 65 61 63 68 ys able to reach
4350: 20 62 65 74 74 65 72 20 63 6f 6d 70 72 65 73 73 better compress
4360: 69 6f 6e 20 72 61 74 69 6f 73 20 74 68 65 6e 20 ion ratios then
4370: 44 45 46 4c 41 54 45 20 28 69 74 20 64 65 70 65 DEFLATE (it depe
4380: 6e 64 73 20 6f 6e 20 74 68 65 20 73 61 6d 70 6c nds on the sampl
4390: 65 27 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 e's information
43a0: 65 6e 74 72 6f 70 79 29 2e 3c 62 72 3e 0d 0a 4f entropy).<br>..O
43b0: 6e 20 6d 61 6e 79 20 63 6f 6d 6d 6f 6e 20 63 61 n many common ca
43c0: 73 65 73 20 5a 53 54 44 20 63 61 6e 20 65 61 73 ses ZSTD can eas
43d0: 69 6c 79 20 6f 75 74 70 65 72 66 6f 72 6d 20 44 ily outperform D
43e0: 45 46 4c 41 54 45 20 63 6f 6d 70 72 65 73 73 69 EFLATE compressi
43f0: 6f 6e 20 72 61 74 69 6f 73 2e 3c 62 72 3e 0d 0a on ratios.<br>..
4400: 57 68 65 6e 20 6e 6f 74 2c 20 69 74 20 73 74 69 When not, it sti
4410: 6c 6c 20 72 65 6d 61 69 6e 73 20 61 62 6c 65 20 ll remains able
4420: 74 6f 20 61 63 68 69 65 76 65 20 28 6d 6f 72 65 to achieve (more
4430: 20 6f 72 20 6c 65 73 73 29 20 74 68 65 20 73 61 or less) the sa
4440: 6d 65 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 72 me compression r
4450: 61 74 69 6f 73 20 74 68 61 6e 20 44 45 46 4c 41 atios than DEFLA
4460: 54 45 20 62 75 74 20 69 6e 20 61 20 66 61 73 74 TE but in a fast
4470: 65 72 20 74 69 6d 65 2e 3c 2f 6c 69 3e 0d 0a 3c er time.</li>..<
4480: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4c /ul></li>..<li>L
4490: 5a 34 20 69 73 20 6e 6f 74 20 72 65 61 6c 6c 79 Z4 is not really
44a0: 20 69 6e 74 65 72 65 73 74 69 6e 67 20 28 61 74 interesting (at
44b0: 20 6c 65 61 73 74 20 66 6f 72 20 67 65 6e 65 72 least for gener
44c0: 61 6c 20 70 75 72 70 6f 73 65 20 73 63 6f 70 65 al purpose scope
44d0: 73 29 2e 0d 0a 49 74 27 73 20 73 75 72 65 6c 79 s)...It's surely
44e0: 20 76 65 72 79 20 66 61 73 74 2c 20 62 75 74 20 very fast, but
44f0: 6e 6f 74 20 69 6d 70 72 65 73 73 69 76 65 6c 79 not impressively
4500: 20 66 61 73 74 65 72 20 74 68 61 6e 20 5a 53 54 faster than ZST
4510: 44 2e 3c 62 72 3e 0d 0a 41 6e 64 20 69 74 27 73 D.<br>..And it's
4520: 20 63 6f 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 compression rat
4530: 69 6f 73 20 61 72 65 20 61 6c 77 61 79 73 20 74 ios are always t
4540: 6f 6f 20 6d 69 6c 64 20 61 6e 64 20 62 6c 61 6e oo mild and blan
4550: 64 20 74 6f 20 62 65 20 72 65 61 6c 6c 79 20 61 d to be really a
4560: 70 70 65 61 6c 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a ppealing.</li>..
4570: 3c 6c 69 3e 4c 5a 4d 41 20 68 61 73 20 6e 6f 20 <li>LZMA has no
4580: 61 6c 74 65 72 6e 61 74 69 76 65 73 20 77 68 65 alternatives whe
4590: 6e 20 76 65 72 79 20 73 74 72 6f 6e 67 20 63 6f n very strong co
45a0: 6d 70 72 65 73 73 69 6f 6e 20 72 61 74 69 6f 73 mpression ratios
45b0: 20 61 72 65 20 61 6e 20 61 62 73 6f 6c 75 74 65 are an absolute
45c0: 20 6d 75 73 74 2e 3c 62 72 3e 0d 0a 42 75 74 20 must.<br>..But
45d0: 69 74 73 20 74 65 72 72 69 62 6c 65 20 73 6c 6f its terrible slo
45e0: 77 6e 65 73 73 20 28 62 6f 74 68 20 77 68 65 6e wness (both when
45f0: 20 63 6f 6d 70 72 65 73 73 69 6e 67 20 61 6e 64 compressing and
4600: 20 64 65 63 6f 6d 70 72 65 73 73 69 6e 67 29 20 decompressing)
4610: 6d 75 73 74 20 61 6c 77 61 79 73 20 62 65 20 74 must always be t
4620: 61 6b 65 6e 20 69 6e 20 76 65 72 79 20 73 65 72 aken in very ser
4630: 69 6f 75 73 20 61 63 63 6f 75 6e 74 2c 20 62 65 ious account, be
4640: 63 61 75 73 65 20 69 74 20 63 6f 75 6c 64 20 65 cause it could e
4650: 61 73 69 6c 79 20 62 65 63 6f 6d 65 20 61 20 73 asily become a s
4660: 65 76 65 72 65 20 62 6f 74 74 6c 65 6e 65 63 6b evere bottleneck
4670: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 44 45 46 4c .</li>..<li>DEFL
4680: 41 54 45 20 69 73 6e 27 74 20 61 74 20 61 6c 6c ATE isn't at all
4690: 20 64 65 61 64 3b 20 64 65 73 70 69 74 65 20 69 dead; despite i
46a0: 74 73 20 72 61 74 68 65 72 20 76 65 6e 65 72 61 ts rather venera
46b0: 62 6c 65 20 61 67 65 20 69 74 20 73 74 69 6c 6c ble age it still
46c0: 20 63 6f 6e 66 69 72 6d 73 20 74 6f 20 62 65 20 confirms to be
46d0: 61 6e 20 68 6f 6e 65 73 74 20 70 65 72 66 6f 72 an honest perfor
46e0: 6d 65 72 2e 3c 62 72 3e 0d 0a 41 6e 64 20 63 6f mer.<br>..And co
46f0: 6e 73 69 64 65 72 69 6e 67 20 69 74 73 20 61 6c nsidering its al
4700: 6d 6f 73 74 20 75 6e 69 76 65 72 73 61 6c 20 61 most universal a
4710: 6e 64 20 70 65 72 76 61 73 69 76 65 20 61 64 6f nd pervasive ado
4720: 70 74 69 6f 6e 20 69 74 20 77 69 6c 6c 20 73 75 ption it will su
4730: 72 65 6c 79 20 73 75 72 76 69 76 65 20 66 6f 72 rely survive for
4740: 20 6d 61 6e 79 20 6c 6f 6e 67 20 79 65 61 72 73 many long years
4750: 20 74 6f 20 63 6f 6d 65 2e 3c 2f 6c 69 3e 0d 0a to come.</li>..
4760: 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 68 72 </ul>..<br>..<hr
4770: 3e 0d 0a 3c 68 31 3e 54 65 73 74 69 6e 67 20 52 >..<h1>Testing R
4780: 61 73 74 65 72 20 43 6f 76 65 72 61 67 65 73 3c aster Coverages<
4790: 2f 68 31 3e 0d 0a 54 68 69 73 20 73 65 63 6f 6e /h1>..This secon
47a0: 64 20 67 72 6f 75 70 20 6f 66 20 74 65 73 74 73 d group of tests
47b0: 20 77 69 6c 6c 20 62 65 20 6d 6f 72 65 20 73 70 will be more sp
47c0: 65 63 69 66 69 63 61 6c 6c 79 20 61 69 6d 65 64 ecifically aimed
47d0: 20 74 6f 20 64 69 72 65 63 74 6c 79 20 63 6f 6d to directly com
47e0: 70 61 72 65 20 74 68 65 20 76 61 72 69 6f 75 73 pare the various
47f0: 20 6c 6f 73 73 6c 65 73 73 20 63 6f 6d 70 72 65 lossless compre
4800: 73 73 69 6f 6e 20 6d 65 74 68 6f 64 73 20 61 73 ssion methods as
4810: 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 62 79 20 implemented by
4820: 52 61 73 74 65 72 4c 69 74 65 32 20 66 6f 72 20 RasterLite2 for
4830: 65 6e 63 6f 64 69 6e 67 20 61 6e 64 20 64 65 63 encoding and dec
4840: 6f 64 69 6e 67 20 74 69 6c 65 73 20 73 75 70 70 oding tiles supp
4850: 6f 72 74 69 6e 67 20 52 61 73 74 65 72 20 43 6f orting Raster Co
4860: 76 65 72 61 67 65 73 2e 0d 0a 3c 75 6c 3e 0d 0a verages...<ul>..
4870: 3c 6c 69 3e 46 6f 72 20 65 61 63 68 20 73 61 6d <li>For each sam
4880: 70 6c 65 20 73 65 76 65 72 61 6c 20 64 69 73 74 ple several dist
4890: 69 6e 63 74 20 52 61 73 74 65 72 4c 69 74 65 32 inct RasterLite2
48a0: 20 64 61 74 61 62 61 73 65 73 20 77 69 6c 6c 20 databases will
48b0: 62 65 20 63 72 65 61 74 65 64 20 61 6e 64 20 66 be created and f
48c0: 75 6c 6c 79 20 70 6f 70 75 6c 61 74 65 64 20 62 ully populated b
48d0: 79 20 69 6d 70 6f 72 74 69 6e 67 20 74 68 65 20 y importing the
48e0: 73 61 6d 65 20 73 61 6d 70 6c 65 20 62 75 74 20 same sample but
48f0: 62 79 20 61 70 70 6c 79 69 6e 67 20 61 20 64 69 by applying a di
4900: 66 66 65 72 65 6e 74 20 63 6f 6d 70 72 65 73 73 fferent compress
4910: 69 6f 6e 20 6d 65 74 68 6f 64 2e 3c 2f 6c 69 3e ion method.</li>
4920: 0d 0a 3c 6c 69 3e 54 68 65 20 3c 62 3e 63 6f 6d ..<li>The <b>com
4930: 70 72 65 73 73 69 6f 6e 20 72 61 74 69 6f 73 3c pression ratios<
4940: 2f 62 3e 20 77 69 6c 6c 20 62 65 20 74 68 65 6e /b> will be then
4950: 20 63 6f 6d 70 75 74 65 64 20 66 72 6f 6d 20 74 computed from t
4960: 68 65 20 73 69 7a 65 73 20 6f 66 20 74 68 65 20 he sizes of the
4970: 3c 75 3e 75 6e 63 6f 6d 70 72 65 73 73 65 64 3c <u>uncompressed<
4980: 2f 75 3e 20 64 61 74 61 62 61 73 65 20 28 6d 65 /u> database (me
4990: 74 68 6f 64 20 3c 62 3e 4e 4f 4e 45 3c 2f 6e 3e thod <b>NONE</n>
49a0: 29 20 61 6e 64 20 61 6e 79 20 6f 74 68 65 72 20 ) and any other
49b0: 64 61 74 61 62 61 73 65 20 62 61 73 65 64 20 6f database based o
49c0: 6e 20 74 68 65 20 73 61 6d 65 20 73 61 6d 70 6c n the same sampl
49d0: 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68 65 e.</li>..<li>The
49e0: 20 3c 62 3e 63 6f 6d 70 72 65 73 73 69 6f 6e 20 <b>compression
49f0: 73 70 65 65 64 3c 2f 62 3e 20 77 69 6c 6c 20 62 speed</b> will b
4a00: 65 20 74 68 65 20 74 69 6d 65 20 72 65 71 75 69 e the time requi
4a10: 72 65 64 20 66 6f 72 20 63 72 61 74 69 6e 67 20 red for crating
4a20: 61 6e 64 20 66 75 6c 6c 79 20 70 6f 70 75 6c 61 and fully popula
4a30: 74 69 6e 67 20 65 61 63 68 20 64 61 74 61 62 61 ting each databa
4a40: 73 65 20 28 61 73 20 72 65 70 6f 72 74 65 64 20 se (as reported
4a50: 62 79 20 3c 62 3e 72 6c 32 74 6f 6f 6c 3c 2f 62 by <b>rl2tool</b
4a60: 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d >).</li>..</ul>.
4a70: 0a 3c 62 72 3e 0d 0a 3c 68 33 3e 54 65 73 74 20 .<br>..<h3>Test
4a80: 23 35 20 2d 20 47 72 61 79 73 63 61 6c 65 20 52 #5 - Grayscale R
4a90: 61 73 74 65 72 20 43 6f 76 65 72 61 67 65 3c 2f aster Coverage</
4aa0: 68 33 3e 0d 0a 3c 62 72 3e 0d 0a 3c 62 72 3e 0d h3>..<br>..<br>.
4ab0: 0a 3c 68 33 3e 54 65 73 74 20 23 36 20 2d 20 52 .<h3>Test #6 - R
4ac0: 47 42 20 52 61 73 74 65 72 20 43 6f 76 65 72 61 GB Raster Covera
4ad0: 67 65 3c 2f 68 33 3e 0d 0a 3c 62 72 3e 0d 0a 3c ge</h3>..<br>..<
4ae0: 62 72 3e 0d 0a 3c 68 33 3e 54 65 73 74 20 23 37 br>..<h3>Test #7
4af0: 20 2d 20 4d 75 6c 74 69 73 70 65 63 74 72 61 6c - Multispectral
4b00: 20 28 34 2d 62 61 6e 64 73 29 20 52 61 73 74 65 (4-bands) Raste
4b10: 72 20 43 6f 76 65 72 61 67 65 3c 2f 68 33 3e 0d r Coverage</h3>.
4b20: 0a 3c 62 72 3e 0d 0a 3c 62 72 3e 0d 0a 3c 68 33 .<br>..<br>..<h3
4b30: 3e 54 65 73 74 20 23 38 20 2d 20 44 61 74 61 67 >Test #8 - Datag
4b40: 72 69 64 20 52 61 73 74 65 72 20 43 6f 76 65 72 rid Raster Cover
4b50: 61 67 65 20 28 41 53 43 49 49 20 47 72 69 64 20 age (ASCII Grid
4b60: 2d 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 - floating point
4b70: 20 73 69 6e 67 6c 65 20 70 72 65 63 69 73 69 6f single precisio
4b80: 6e 29 3c 2f 68 33 3e 0d 0a 3c 62 72 3e 0d 0a 3c n)</h3>..<br>..<
4b90: 62 72 3e 0d 0a 3c 68 33 3e 54 65 73 74 20 23 39 br>..<h3>Test #9
4ba0: 20 2d 20 44 61 74 61 67 72 69 64 20 52 61 73 74 - Datagrid Rast
4bb0: 65 72 20 43 6f 76 65 72 61 67 65 20 28 54 49 46 er Coverage (TIF
4bc0: 46 20 2d 20 49 4e 54 31 36 29 3c 2f 68 33 3e 0d F - INT16)</h3>.
4bd0: 0a 3c 62 72 3e 0d 0a 3c 62 72 3e 0d 0a 3c 68 72 .<br>..<br>..<hr
4be0: 3e 3c 62 72 3e 0d 0a 42 61 63 6b 20 74 6f 20 3c ><br>..Back to <
4bf0: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
4c00: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f www.gaia-gis.it/
4c10: 66 6f 73 73 69 6c 2f 6c 69 62 72 61 73 74 65 72 fossil/libraster
4c20: 6c 69 74 65 32 2f 77 69 6b 69 3f 6e 61 6d 65 3d lite2/wiki?name=
4c30: 72 61 73 74 65 72 6c 69 74 65 32 2d 64 6f 63 22 rasterlite2-doc"
4c40: 3e 52 61 73 74 65 72 4c 69 74 65 32 20 64 6f 63 >RasterLite2 doc
4c50: 20 69 6e 64 65 78 3c 2f 61 3e 0a 5a 20 33 65 66 index</a>.Z 3ef
4c60: 30 32 36 35 34 65 38 37 35 66 30 64 35 66 34 34 02654e875f0d5f44
4c70: 30 66 34 30 36 33 34 33 61 36 63 62 31 0a 0f406343a6cb1.