\Drupal\views\Plugin\views\display\PathPluginBase::alterRoutes() can become very slow on a site with lots of entities and JsonAPI

Created on 10 November 2021, about 3 years ago
Updated 3 July 2023, over 1 year ago

Problem/Motivation

When you have lots of jsonapi routes the \Drupal\views\Plugin\views\display\PathPluginBase::alterRoutes() method does lots and lots of unnecessary work.

Steps to reproduce

Install JsonAPI and views and rebuild the routes.

Using the standard profile this change results in 2220 less calls to \Drupal\views\Plugin\views\display\PathPluginBase::overrideAppliesPathAndMethod(). On a client site which makes heavy use of JsonAPI and has a *lot* of custom entity types and bundles of said entity types this results in 290556 less calls!

Blackfire runs:

Proposed resolution

Change the order of the if condition.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

πŸ› Bug report
Status

Fixed

Version

9.3

Component
ViewsΒ  β†’

Last updated about 17 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024