Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Compress Savestates #7501

Closed
hizzlekizzle opened this issue Oct 28, 2018 · 8 comments
Closed

[Feature Request] Compress Savestates #7501

hizzlekizzle opened this issue Oct 28, 2018 · 8 comments
Labels
feature request New enhancement to RetroArch.

Comments

@hizzlekizzle
Copy link
Contributor

Description

A number of cores have very large savestates that are mostly empty space, such as PPSSPP, and these can be reduced in size dramatically by compressing them:
image

Compressing them with fast compression, such as gzip, could potentially open such cores up to advanced state-based features such as runahead.

Expected behavior

Savestates should be as small as possible, without a bunch of filler.

Actual behavior

Some cores have states full of empty data

Steps to reproduce the bug

  1. Fire up PPSSPP
  2. Save a state
  3. Look at filesize

Bisect Results

Always

Environment information

  • OS: All
  • Compiler: All
@orbea orbea added the feature request New enhancement to RetroArch. label Oct 29, 2018
@ghost
Copy link

ghost commented Oct 30, 2018

Use LZ4 with a basic file quantum for storing compressed/uncompressed file lengths. You could use a hardware accelerated CRC32 (using the CRC32 opcodes on SSE4, OR SSE2/NEON optimized CRC32 for folding. Look at Intel's paper on the subject.) on the data for checking integrity. Might be able to exploit HW SHA-1 too.

@RobLoach
Copy link
Member

There are concerns around savestate compression and netplay. There was a fast flag added recently to help this. May be the core's responsibility now?

@andres-asm
Copy link
Contributor

andres-asm commented Oct 30, 2018 via email

@ghost
Copy link

ghost commented Nov 1, 2018

Are savestates saved in worker threads? If thats the case you could use a stronger algo like LZMA even.

@andres-asm
Copy link
Contributor

andres-asm commented Nov 2, 2018 via email

@ghost
Copy link

ghost commented Nov 2, 2018

Ah, thanks.
In einweg, I could use the Windows 7 worker thread API for those.

@meepingsnesroms
Copy link
Contributor

Someone has requested this for Mu too:
meepingsnesroms/Mu#87

The savestates contain the entire RAM(which includes the filesystem on Palm OS devices).

This is 16MB on Palm OS 4 and will be 64MB on Palm OS 5.

@hizzlekizzle
Copy link
Contributor Author

This has been implemented by jdgleaver, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New enhancement to RetroArch.
Projects
None yet
Development

No branches or pull requests

5 participants