- Issue created by @niklan
- Status changed to Needs review
over 1 year ago 1:32pm 25 September 2023 - last update
over 1 year ago 30,195 pass, 5 fail - π·πΊRussia niklan Russia, Perm
This is a very dirty patch to see how tests will react on it.
This is TOP 10 calls during installation after fix applied.
You can see that both,
Drupal\Core\Config\FileStorage->getAllCollectionNamesHelper()
andphp::SplFileInfo->isDir()
disappears from the list.Drupal\Core\Config\FileStorage->getAllCollectionNamesHelper()
calls went from 36'392 β 4'551php::SplFileInfo->isDir()
calls went from 13'937'541 β 23'710
I measured installation time by
time drush site:install --existing-config
and results are:- Before:
real 8m 38.06s
- After:
real 7m 9.09s
It's roughly ~15% increase in site installation speed.
The last submitted patch, 2: drupal-3389567-2.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 4:06am 26 September 2023 - π·πΊRussia niklan Russia, Perm
It looks like some code will break. Can we decorate that service specifically for installation process? Because I don't think this caching is actually needed for regular runtime process, but it's a very significant improvement for installation. I don't see any cases where configurations are changed on disc during installation, hence, this caching should not do any harm.
- π·πΊRussia niklan Russia, Perm
This profiling results for
drush site:install --existing-config
with a specific website configuration. It is not an issue on default profiles (because they are simple and small) or a smaller website (which have fewer configs). But a multilingual website, with something like 10 languages, a lot of content types, fields, etc., configs grows in size very fast, and this is where the issue starts. The profiler is clearly shows, that the more configurations you have, the more calls forDrupal\Core\Config\FileStorage->getAllCollectionNamesHelper()
which is bottlenecked by aphp::SplFileInfo->isDir()
- the unique calls of which is hundreds times fewer than the actual one. In my example, it means for one unique file, it calls this check 587 times.This issue reproduced everywhere, on different developers PCs and CI's.
- π¬π§United Kingdom alexpott πͺπΊπ
I feel we need to fund out why we're call getAllCollectionNames() and work from there.
- π«π·France andypost
static cache is workaround, as file cache should be applied in other place
- π«π·France andypost
bottlenecked by a php::SplFileInfo->isDir() - the unique calls of which is hundreds times fewer than the actual one. In my example, it means for one unique file, it calls this check 587 times.
it means filecache miss