mirror of https://github.com/PCSX2/pcsx2.git
SaveState: Switch to zstd compression
zstd can be 10x+ fast compressing, 2x+ decompressing at default levels, and provides slightly better ratios. There's a hidden option in the config, SavestateZstdCompression, which you can set to false if you want to use deflate.
This commit is contained in:
parent
a22c634cd4
commit
6991f819f3
|
@ -939,6 +939,7 @@ struct Pcsx2Config
|
|||
// when enabled uses BOOT2 injection, skipping sony bios splashes
|
||||
UseBOOT2Injection : 1,
|
||||
BackupSavestate : 1,
|
||||
SavestateZstdCompression : 1,
|
||||
// enables simulated ejection of memory cards when loading savestates
|
||||
McdEnableEjection : 1,
|
||||
McdFolderAutoManage : 1,
|
||||
|
|
|
@ -1021,6 +1021,7 @@ Pcsx2Config::Pcsx2Config()
|
|||
EnableGameFixes = true;
|
||||
#endif
|
||||
BackupSavestate = true;
|
||||
SavestateZstdCompression = true;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
McdCompressNTFS = true;
|
||||
|
@ -1060,6 +1061,7 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
|
|||
SettingsWrapBitBool(HostFs);
|
||||
|
||||
SettingsWrapBitBool(BackupSavestate);
|
||||
SettingsWrapBitBool(SavestateZstdCompression);
|
||||
SettingsWrapBitBool(McdEnableEjection);
|
||||
SettingsWrapBitBool(McdFolderAutoManage);
|
||||
SettingsWrapBitBool(MultitapPort0_Enabled);
|
||||
|
|
|
@ -806,10 +806,9 @@ static void ZipStateToDiskOnThread(std::unique_ptr<ArchiveEntryList> srclist, st
|
|||
// discard zip file if we fail saving something
|
||||
ScopedGuard zip_discarder([&zf]() { zip_discard(zf.release()); });
|
||||
|
||||
// use deflate compression by default
|
||||
// TODO: switch to zstd
|
||||
constexpr u32 compression = ZIP_CM_DEFLATE;
|
||||
constexpr u32 compression_level = 0;
|
||||
// use zstd compression, it can be 10x+ faster for saving.
|
||||
const u32 compression = EmuConfig.SavestateZstdCompression ? ZIP_CM_ZSTD : ZIP_CM_DEFLATE;
|
||||
const u32 compression_level = 0;
|
||||
|
||||
// version indicator
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue