Memcard: Remove unnecessary FSeek64 for speed improvements #12132
+16
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.