lzma和lz4速度比较
Compressed file size in bytes
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
1 |
124875819 (120M) |
93997047 (90M) |
85618192 (82M) |
72042179 (69M) |
85630688 (82M) |
72069084 (69M) |
165844264 (159M) |
168012430 (161M) |
2 |
119040249 (114M) |
87741348 (84M) |
81480824 (78M) |
70264395 (68M) |
81492504 (78M) |
70282944 (68M) |
165844264 (159M) |
166987891 (160M) |
3 |
114931686 (110M) |
84816957 (81MB) |
79575087 (76MB) |
69015118 (66MB) |
79586568 (76MB) |
69029204 (66MB) |
165844264 (159M) |
166987891 (160M) |
5 |
102328357 (98M) |
81837328 (79M) |
69557610 (67M) |
67879362 (65M) |
69583428 (67M) |
67875988 (65M) |
- |
166987891 (160M) |
7 |
100128597 (96M) |
80197758 (77M) |
67276420 (65M) |
66868212 (64M) |
67294092 (65M) |
66852780 (64M) |
- |
116205578 (111M) |
9 |
99740486 (96M) |
78963640 (76M) |
65841213 (63M) |
65362226 (63M) |
65859432 (63M) |
65372696 (63M) |
- |
114824102 (110M) |
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
可以看出lzma的压缩大小比lz4小。所以加载lzma的速度会快,lz4的速度会慢
Compression ratio
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
1 |
26.8% |
20.2% |
18.4% |
15.5% |
18.4% |
15.5% |
35.6% |
36.0% |
2 |
25.5% |
18.8% |
17.5% |
15.1% |
17.5% |
15.1% |
35.6% |
35.8% |
3 |
24.7% |
18.2% |
17.1% |
14.8% |
17.1% |
14.8% |
35.6% |
35.8% |
5 |
22.0% |
17.6% |
14.9% |
14.6% |
14.9% |
14.6% |
- |
35.8% |
7 |
21.5% |
17.2% |
14.4% |
14.3% |
14.4% |
14.3% |
- |
24.9% |
9 |
21.4% |
16.9% |
14.1% |
14.0% |
14.1% |
14.0% |
- |
24.6% |
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
压缩比这里lzma大概再17%左右,lz4再35%左右,所以压缩率lz4会高
Compression time
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
1 |
8.1s |
58.3s |
31.7s |
4m37s |
32.2s |
4m40s |
1.3s |
1.6s |
2 |
8.5s |
58.4s |
40.7s |
4m49s |
41.9s |
4m53s |
1.4s |
1.6s |
3 |
9.6s |
59.1s |
1m2s |
4m36s |
1m1s |
4m39s |
1.3s |
1.5s |
5 |
14s |
1m1s |
3m5s |
5m |
3m6s |
4m53s |
- |
1.5s |
7 |
21s |
1m2s |
4m14s |
5m52s |
4m13s |
5m57s |
- |
35s |
9 |
33s |
1m3s |
4m48s |
6m40s |
4m51s |
6m40s |
- |
1m5s |
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
压缩时间lzma会远远高于lz4.
Decompression time
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
1 |
3.5s |
3.4s |
6.7s |
5.9s |
7.2s |
6.5s |
0.4s |
1.5s |
2 |
3s |
15.7 |
6.3s |
5.6s |
6.8s |
6.3s |
0.3s |
1.4s |
3 |
3.2s |
15.9s |
6s |
5.6s |
6.7s |
6.2s |
0.4s |
1.4s |
5 |
3.2s |
16s |
5.5s |
5.4s |
6.2s |
6s |
- |
1.5s |
7 |
3s |
15s |
5.3s |
5.3s |
5.9s |
5.8s |
- |
1.3s |
9 |
3s |
15s |
5s |
5.1s |
5.6s |
5.6s |
- |
1.2s |
|
gzip |
bzip2 |
lzma |
lzma -e |
xz |
xz -e |
lz4 |
lzop |
解压缩时间也是。所以可以得知lzma的解压缩时间比lz4慢。lz4的解压缩时间比较快。
所以总结是lzma的解加载速度比较快,lz4的解压缩时间比较快。但是从压缩比和速度来看lz4会更优
参考:https://blog.csdn.net/leilonghao/article/details/73200859