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

feat(sim): startup can be slow when scanning SYSTEM audio files #5822

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Jan 22, 2025

The simulator f_readdir() function calls f_stat for each file in the directory.
This can be slow especially on network drives when the code is scanning the SYSTEM sounds folder, looking for the system sounds.

This PR changes the logic for the simulator to loop over the system sound files names, calling f_stat() for each one.

On my Mac this reduces the sound file scan time from 5.7s to 1.4s when reading from a NAS drive.

@philmoz philmoz added enhancement ✨ New feature or request simulator labels Jan 22, 2025
@philmoz philmoz added this to the 2.11 milestone Jan 22, 2025
@pfeerick pfeerick changed the title feat(simu): simulator startup can be slow when scanning SYSTEM audio files. feat(sim): startup can be slow when scanning SYSTEM audio files Jan 22, 2025
@philmoz philmoz force-pushed the philmoz/speed-up-simu-start branch from c6befe6 to 88e6174 Compare January 25, 2025 00:04
@pfeerick
Copy link
Member

I'm seeing a nice improvement here also on Windows...

Handset Sim Before (ms) After (ms)
T20 2920 670
TX16S 2950 630

@pfeerick pfeerick merged commit 0e8f893 into main Jan 25, 2025
52 checks passed
@pfeerick pfeerick deleted the philmoz/speed-up-simu-start branch January 25, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request simulator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants