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

Improve file-system accesses #688

Merged
merged 1 commit into from
Feb 28, 2021
Merged

Improve file-system accesses #688

merged 1 commit into from
Feb 28, 2021

Conversation

pjft
Copy link
Collaborator

@pjft pjft commented Oct 3, 2020

This change improves file-system accesses, especially on remote systems.
Currently there are multiple instances of unnecessary file-system accesses for checking if files exist, including consecutively when updating the UI and loading the assets for each game during navigation.
This implements a quick and dirty index map for such "exists" operations that are somewhat expensive in remote storage scenarios (NAS), averaging 100ms each, causing navigation to be unnecessarily slow.

Also, changed some of the file-system accesses and calculations on the video player front.

If useful I can implement this as an option, but didn't want to over-engineer it. I suppose the only reason that this would not be desired is if the actual files that ES expects to point to actually change in runtime, outside of ES, but since there's also no "re-scan" feature for file-system changes right now, I imagine that this will not be a meaningful issue. Still, happy to consider.

Added a cache for stat checks
@pjft pjft merged commit f7375d3 into RetroPie:master Feb 28, 2021
pjft added a commit that referenced this pull request Mar 31, 2021
In #688 the change from getCanonicalPath to getAbsolutePath improved performance, but the case of an empty path was not resolving appropriately for the VLC video player.
Copy link

@aarononeal aarononeal left a comment

Choose a reason for hiding this comment

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

@pjft In the trusted game list case, the file system should not be touched until game load. Without other changes, and relying only on this cache, then most likely mPathExistsIndex needs to be pre-initialized with trusted game list paths in order to avoid the stat64 call here. The stat64 call must be eliminated entirely, not just reduced, in the trusted path in order to address performance against clustered storage or high latency networks.

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.

2 participants