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

Use tempfile instead of memory to prepare the plaintext and cipher bu… #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sahlberg
Copy link

@sahlberg sahlberg commented Apr 14, 2024

…ffers

During pack, we read all the files into buffers, then copy them into a plaintext buffer and then encrypt to a cipher buffer.
Resulting in all the file data being stored three times in memory.
This patch moves processing of the crypto to be file based instead of memory buffer based and eliminates two of the three copies being stored in memory.

This greatly reduces the memory footprint when creating the pkg. Example: Peak memory consumption when creating the PKG for a PSX Classics of ResidentEvil2 goes from ~3.7G to ~1.2G.

…ffers

This greatly reduces the memory footprint when creating the pkg.
Example: Peak memory consumption when creating the PKG for RE2
goes from ~3.7G to ~1.2G.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant