Commit 4da30ff
committed
Add:maptool:Compress with libdeflate when it is available
libdeflate produces the same raw deflate format as zlib, only faster.
The library is optional: without it, maptool compresses with zlib as
before. Ubuntu ships the library as libdeflate-dev.
A benchmark on 400 real tiles of a map of France, 38.4 MB:
codec time size against zlib level 9
zlib 9 4.99 s +-0.0%
zlib 6 1.42 s +1.0%
libdeflate 9 1.14 s -0.2%
libdeflate 6 0.32 s -0.6%
libdeflate 12 5.18 s -10.9%
Level 6 of libdeflate is 15.6 times faster than level 9 of zlib and the
result is smaller. Level 12 needs the time of zlib level 9 and gives a
map that is 11 percent smaller, which helps a map that comes near the
2 GiB limit of a GitHub release asset.
Measured on a map of Luxembourg with 8 threads and the parallel
compression: level 9 of zlib needs 4.9 s for the tiles, level 6 of
libdeflate needs 0.7 s. The maps stay semantically identical, every
member has a correct CRC, and two runs give identical files.1 parent 99734ea commit 4da30ff
2 files changed
Lines changed: 36 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
| |||
0 commit comments