Affects Version/s: 3.9.5
Fix Version/s: None
When using Moodle with docker and OSX, the time it takes to install the database is exceptionally slow if the moodle directory is a volume on the host.
Profiling a database installation for phpunit shows that get_files is called excessively.
This excessive calling of "get_files" is because core_component:get_plugin_list_with_file does not utilise static caching for enough files in the static member $filemap.
Currently the files to map are defined as follows:
protected static $filestomap = array('lib.php', 'settings.php');
db/cache.php is requested excessively during the installation.
Other files include db/mobile.php and environment.xml.
Changing $filestomap as follows decreases the install time from 20 minutes to 4 minutes:
protected static $filestomap = array('lib.php', 'settings.php', 'db/caches.php', 'db/mobile.php', 'environment.xml');
NOTE: This issue is not a problem where the file system is native. I'm guessing it could affect windows + docker too although I don't have a windows machine to test it on.