Steps to reproduce:
1. Load admin/modules
2. drush cr
3. Enable a module
4. Look at profiling data for the form POST and the next page render - see two screenshots attached.
Views::getApplicableViews() runs for route rebuilding, menu link plugins, and menu local task plugins. All of these are global registries/caches that completely block normal page rendering for any other request (i.e. not a single themed request can be served until all items have finished building).
With the standard profile they are not great for performance, and they get significantly worse once you have more views enabled on a site.
Note this is currently worse in HEAD due to #2495073: Views feed display plugin has to get all views data on init β - but it makes sense to fix both issues independently of each other, however profiling will see more modest improvements depending on which gets fixed first.
Rather than initializing displays, check the config directly instead. This also avoids initializing the plugins which is itself expensive.
Get that working and profile before/after to see if it sufficiently fixes the issue.
None.
\Drupal\views\Views::getApplicableViews
no longer returns view executables.
$views = Views::getApplicableViews();
foreach ($views as $data) {
list($view, $display_id) = $data;
$id = $view->storage->id();
$this->viewsDisplayPairs[] = $id . '.' . $display_id;
}
$views = Views::getApplicableViews();
foreach ($views as $data) {
list($view_id, $display_id) = $data;
$this->viewsDisplayPairs[] = $view_id . '.' . $display_id;
}
Fixed
8.0 β°οΈ
Last updated
It affects performance. It is often combined with the Needs profiling tag.
Related to the Views in Drupal Core initiative.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.