This is an old revision of the document!
Table of Contents
Archive Types
RomVault supports several different archive options for your ROM sets. Unlike most other ROM managers, RomVault focuses on consistency and normalizes archives. Everyone's archive for a particular set of files will be 100% hash equal if the same archive options are used.
Icon | Type | Compression | Date Normalization | Pros | Cons | Recommended for… |
---|---|---|---|---|---|---|
File | None | None, not required | Fast, directly playable | Significantly more space required | People who use filesystem compression, non-compressible data | |
TrrntZip | Deflate (9) | 1996-12-24 11:32 PM | Compatibility, historic popularity | Weak compression ratio compared to ZSTD and LZMA | Cross platform compatibility, direct playability for many emulators | |
TDC Zip | Deflate (9) | Specified by DAT | A new normalized standard that preserves dates | Archives may not match existing sources | Total DOS Collection. Automatically used with DOSCenter DATs. | |
ZSTD Zip | ZSTD (19) | Null | Compression ratio between Deflate and LZMA, very fast decompression, multithreaded | Not widely supported yet, but works with WinRAR and 7-zip | People who want a better compression ratio and faster decompression than Deflate. | |
Non-Solid LZMA 7z | LZMA (9) | Null | Excellent compression, raw copy supported | Extremely slow, single threaded | People who want to sacrifice some compression ratio over solid LZMA for the ability to raw copy files between archives. | |
Solid LZMA 7z (RV7z) | LZMA (9) | Null | Excellent compression, especially for many files packed together | Extremely slow, single threaded, must unpack completely for any fix | People who care about compression ratio only and don't care how slow LZMA is. | |
Non-Solid ZSTD 7z | ZSTD (19) | Null | Compression ratio between Deflate and LZMA, very fast decompression, multithreaded, raw copy supported | Poorly supported, only works with zstd fork of 7-zip | Default 7z structure for archives that need to be repacked in ToSort directories. | |
Solid ZSTD 7z | ZSTD (19) | Null | Compression ratio between Deflate and LZMA, very fast decompression, multithreaded | Poorly supported, only works with zstd fork of 7-zip, must unpack completely for any fix | Archives with many small files that likely won't change often, and you want fast decompression speed. |
Which archive type should I use?
It depends. Each archive type has pros and cons, but you don't need to choose just one. Choose an archive type that best fits your use case for a particular collection. For example, if you plan to extract discs from archives to load into an emulator, you may prefer ZSTD Zip due its fast decompression speed. That being said, ZSTD Zip is essentially a modernized TrrntZip and seems to be the most popular choice since it was introduced with RomVault 3.7.0.
Why is LZMA so slow?
Although LZMA has an excellent compression ratio, it is unfortunately single-threaded. RomVault uses maximum compression for LZMA, similar to torrent7zip. Compression and decompression are simply slow. LZMA may not be the best choice unless your goal is maximum space savings for archival purposes.
What is ZSTD?
There is a lot of existing technical documentation about ZSTD, but the most important pieces of information to know are:
- Its a modern open source compression algorithm originally developed by Facebook
- Its designed to be highly tunable replacement for Deflate
- Its now well established and used for filesystem compression with ZFS and BTRFS
- Its gaining popularity and support for ZSTD Zip archives was added to MAME v0.262 in January 2024
- It supports multi-threaded compression
- Its designed to be seekable with block sizes up to 128 KiB (compared to Deflate's 32 KiB)
- Its standard levels are 1-19, and ultra levels are 20-22 which require significantly more memory
How does the compression ratio of ZSTD compare to Deflate and LZMA?
ZSTD level 19 has a compression ratio right in between Deflate level 9 and LZMA level 9. However, since ZSTD is multithreaded its much faster to compress compared to LZMA and often times faster than Deflate. ZSTD also decompresses much faster than both LZMA and Deflate.
Why is ZSTD slow when compressing archives with many smaller files?
RomVault's implementation of ZSTD uses compression level 19 without any additional parameters or long distance matching. ZSTD is multi-threaded but each thread or worker is assigned a job of a specific size. ZSTD level 19 uses a job size of 32 MiB. This means any compression stream under 32 MiB will only use a single worker. Conversely a stream of 500 MiB will use up to 16 workers simultaneously.
Why does RomVault use ZSTD level 19? Why not level 22? Why can't I choose my own?
There are several reasons:
- RomVault has always focused on consistency and normalization, and purposely provides a limited set of the options that best accommodates the use cases of the community.
- Levels 20-22 are considered “ultra” and have significantly higher memory requirements which may not work for many users.
- The space savings above level 19 are marginal for most use cases.
- Levels above 19 will often have significantly slower compression since the job size per worker is much larger.
What's the difference between the ZSTD levels?
RomVault uses ZSTD level 19, which you cannot change. The details of the ZSTD levels are outlined below:
- Window Log: The window size represented as an exponent, 2^X bytes.
- Window Size: The size of the sliding window the algorithm uses. Larger window sizes can match patterns further away, but at the cost of higher memory utilization and speed.
- Job Size: The amount of a data allocated to a single worker (thread).
- Strategy: The specific compression approach used.
Level | Window Log | Window Size | Job Size | Strategy |
---|---|---|---|---|
Standard | ||||
1 | 19 | 512 KiB | 2 MiB | ZSTD_fast |
2 | 19 | 512 KiB | 2 MiB | ZSTD_fast |
3 | 20 | 1 MiB | 4 MiB | ZSTD_dfast |
4 | 21 | 2 MiB | 8 MiB | ZSTD_dfast |
5 | 21 | 2 MiB | 8 MiB | ZSTD_greedy |
6 | 21 | 2 MiB | 8 MiB | ZSTD_lazy |
7 | 21 | 2 MiB | 8 MiB | ZSTD_lazy |
8 | 21 | 2 MiB | 8 MiB | ZSTD_lazy2 |
9 | 22 | 4 MiB | 16 MiB | ZSTD_lazy2 |
10 | 22 | 4 MiB | 16 MiB | ZSTD_lazy2 |
11 | 22 | 4 MiB | 16 MiB | ZSTD_lazy2 |
12 | 22 | 4 MiB | 16 MiB | ZSTD_lazy2 |
13 | 22 | 4 MiB | 16 MiB | ZSTD_btlazy2 |
14 | 22 | 4 MiB | 16 MiB | ZSTD_btlazy2 |
15 | 22 | 4 MiB | 16 MiB | ZSTD_btlazy2 |
16 | 22 | 4 MiB | 16 MiB | ZSTD_btopt |
17 | 23 | 8 MiB | 32 MiB | ZSTD_btopt |
18 | 23 | 8 MiB | 32 MiB | ZSTD_btultra |
19 | 23 | 8 MiB | 32 MiB | ZSTD_btultra2 |
Ultra | ||||
20 | 25 | 32 MiB | 128 MiB | ZSTD_btultra2 |
21 | 26 | 64 MiB | 256 MiB | ZSTD_btultra2 |
22 | 27 | 128 MiB | 512 MiB | ZSTD_btultra2 |