Skip to content

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 <[email protected]>
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