Comparison of Zlib/Oodle/ZSTD algorithm performance

Zlib/Oodle/ZSTD压缩算法性能对比

I previously wrote an article about integrating the ZSTD compression algorithm into UE: ModularFeature: Integrating ZSTD Compression Algorithm into UE4, and extracted the Oodle compression algorithm library from UE5 for use in UE4: Oodle Compression. Recently, I analyzed their compression, decompression, CPU, and memory consumption, testing on three platforms: WindowsNoEditor, Android_ASTC, and iOS, as well as the performance of Oodle’s Kraken using different compression levels on different platforms.

Packaging and testing methods:

  1. Create a default zlib base package that does not contain any resources.
  2. The base package includes code for oodle/zstd, allowing specification of the compressor and compresslevel at startup.
  3. Use HotPatcher to package StarterContent. Each time, package for three platforms, specifying the compression algorithm, compressor, and compression level through commands.
  4. During runtime, use Perfdog and stat compression to view data.

The sizes of the StarterContent packaged with different compression algorithms (in MB). The size of the uncompressed Pak:

Uncompress Pak Size
WindowsNoEditor 465M
Android_ASTC 260M
iOS 291M

In the following data, Oodle uses the default Fast compression level, with the distinction being the different compressors.

- ZLIB OODLE(Kraken) OODLE(Leviathan) Oodle(Hydra) ZSTD(Level22)
WindowsNoEditor 295.93 284 273.18 278.40 286
Android_ASTC 177 170 165 167 171
iOS 174 162 155 158 163

In Oodle’s Fast mode, packaging StarterContent for the Android_ASTC, iOS, and WindowsNoEditor platforms took approximately 35 seconds in total just for packing the Pak.

When the compression level is set to the maximum Optimal5, the compression speed significantly decreases, but the compression ratio noticeably improves, taking about +00:06:55.764 across three platforms, which is roughly seven minutes.

- Leviathan(Fast) Leviathan(Optimal5) Leviathan(Optimal2) ZSTD Level 22
WindowsNoEditor 273.18 (13.54s) 263 (180.63s) 266 (41.69s) 286(31.24s)
Android_ASTC 165 (8.39s.) 152 (95.59s) 157 (23.19s) 171(19.86s)
iOS 155 (10.38s) 147 (138.13s) 150 (34.96s) 163(20.43s)

Comparison of Kraken using different compression levels (runtime comparison data is at the end of the document):

- Kraken(Fast) Kraken(Optimal5) Kraken(Optimal2)
WindowsNoEditor 283 (5.83s) 273 (82.24) 276 (41.69s)
Android_ASTC 170 (3.52s.) 161 (49.88s) 166 (23.19s)
iOS 161 (4.01s) 152 (57.34s) 155 (34.96s)

Using stat combined with PerfDog to analyze the efficiency of various compression algorithms, the testing method involved loading Pak packaged with different compression algorithms, entering the same map (/Game/StarterContent/Maps/StarterMap), enabling stat compression, and reviewing performance data after three minutes of navigating the entire scene (for mobile, PerfDog analysis is enabled, which may have some performance impact, but all mobile tests use the same operations and processes, making the data comparison accuracy acceptable).

WindowsNoEditor

  1. zlib
  2. oodle(Kraken+fast)
  3. oodle(Hydra+fast)
  4. oodle(Leviathan+fast)
  5. zstd(level22)

Android_ASTC

  1. zlib

  2. oodle(Kraken+fast)



  3. oodle(Hydra+fast)

  4. oodle(Leviathan+fast)

  5. zstd(level22)

iOS

  1. zlib

  2. oodle(Kraken+fast)

  3. oodle(Hydra+fast)

  4. oodle(Leviathan+fast)

  5. zstd(level22)

Comparison of different Kraken compression levels

The test package and Perfdog environment were the same as described above.

WindowsNoEditor

  1. Fast

  2. Optimal2

  3. Optimal5

Android_ASTC

  1. Fast

  2. Optimal2

  3. Optimal5

iOS

  1. Fast

  2. Optimal2

  3. Optimal5

Summary

The compression ratio and decompression performance are factors that trade off against each other. From the comparison data, both Oodle and ZSTD maintain a high compression ratio while far outperforming Zlib in decompression efficiency. The comparison data shows that the performance of ZSTD at level 22 is comparable to that of Oodle’s Leviathan, while Kraken excels in decompression speed. Therefore, using Kraken+fast in games is a fairly reasonable solution. Even when selecting other CompressLevel options like Optimal2 or Optimal5, the compression time can increase several times, which may not be worth it in projects with a large amount of resources.

The article is finished. If you have any questions, please comment and communicate.

Scan the QR code on WeChat and follow me.

Title:Comparison of Zlib/Oodle/ZSTD algorithm performance
Author:LIPENGZHA
Publish Date:2021/07/06 19:59
Word Count:3.6k Words
Link:https://en.imzlp.com/posts/30732/
License: CC BY-NC-SA 4.0
Reprinting of the full article is prohibited.
Your donation will encourage me to keep creating!