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

Memory Cards: Use file memory mapping instead of explicit file I/O #12187

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

F0bes
Copy link
Member

@F0bes F0bes commented Jan 12, 2025

(This is a rough draft, Windows only for now until a more elegant interface is created)

Description of Changes

Instead of freads for every memory card read, map the entire memory card into a memory mapping and let the OS manage caching / paging (hopefully) a little more efficient.

Rationale behind Changes

This completely eliminated a bottleneck I found on the Persona 3 memory card menu. Overall memory card reads and block clearing should be faster with less EE thread usage.

Suggested Testing Steps

This is experimental and with all memory card code changes, scary! Please do not try this on memory cards you don't want to possibly lose. Writes to the memory card excluding clears still use file IO, so in theory it should be safe from causing corruption.

To test you just have see if memory card stuff works. Saving / formatting / reading.

Copy link
Contributor

@kamfretoz kamfretoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works good on both linux and mac

@F0bes F0bes force-pushed the memory-card-destroyer-9000 branch from 60b8da1 to 7fcfbda Compare January 14, 2025 02:49
@F0bes F0bes force-pushed the memory-card-destroyer-9000 branch from 7fcfbda to cbc55d4 Compare January 14, 2025 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants