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

Memcard: Remove unnecessary FSeek64 for speed improvements #12132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RedPanda4552
Copy link
Contributor

Description of Changes

Old memcard code was doing FSeek64 calls extremely often which was thrashing performance. One culprit was support for legacy PSX memcards with special headers, which I would argue are no longer used (or should no longer be used). The other was being used when fetching the card's size info, which is done on every sector change. FSeek64 is now called once upon card opening.

Rationale behind Changes

Card size is static through PCSX2's lifecycle and only needs retrieved once. Doing so provides significant performance improvements as the IOP is no longer constantly performing unnecessary IO on the host file essentially every RPC call.

Suggested Testing Steps

As always with memcard tests, make copies and use those for testing.

Boot all variety of games and test for data to load and save normally. Compare EE thread performance on master branch to this PR; mild to moderate reduction in EE thread utilization during load/save operations should be noted.

JRPGs among other games which use "save slots" and have in-game menus displaying them may be a prime test case, as such games are constantly making RPC calls to the memcard doing reads or otherwise checking card status to update the list. Check these games as well and see if EE utilization has decreased in these menus.

Supporting legacy PSX cards with headers required constant size checks, thrashing IOP performance.
Prevents FSeek64 hits on every retrieval of memcard attributes
@Loy2up
Copy link

Loy2up commented Jan 1, 2025

Someone should check if it fixes #7316

@Mrlinkwii
Copy link
Contributor

Mrlinkwii commented Jan 1, 2025

@Loy2up it was checked, sadly it dosent i believe

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.

3 participants