schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
775 stars 65 forks source link

Slow core startup due to large system folder #192

Open ckeisc opened 3 years ago

ckeisc commented 3 years ago

I think due to the code that recursively searches for sound font and control rom in system folder, if you have a large system folder such as having dolphin core’s large Sys folder with 1300+ files, Dosbox Pure core start time would be materially impacted.

With dolphin core, on Xbox Series X even with fast SSD but perhaps slow VFS implementation, just starting the core could take 15 seconds. I deleted the dolphin folder and the core start up time drops to ~3 seconds.

Can we either cache the search results or limit the search scope?

schellingb commented 3 years ago

Thanks for the report! It's unfortunate how slow file system enumeration on UWP platforms like XSX is... I agree this needs to be addressed somehow. Limiting the scope seems hard, I can see that easily cause confusion. Maybe it would be ok to stop evaluating a directory after 100 or so files. But what if someone has 1000 directories. I think I'll do the following: Decide to create a cache file once the recursion takes longer than 1 or 2 seconds. And if a cache file exists, use that in the first place but also show a "Rescan System Folder" item under the MIDI option. It's a bit crude but it should be enough to have most users be able to use all the features without needing to look up any documentation (that might not even exist).

schellingb commented 3 years ago

The improvement is now released in version 0.17. Not sure when the version for your platform will be built, but once it is available, please test it :-)

ckeisc commented 3 years ago

Will monitor when new Xbox build cones out and test. Thank you!