Excessive database queries in processOutbound causing performance issues

Created on 22 September 2023, 9 months ago
Updated 28 September 2023, 9 months ago

Problem/Motivation

Webprofiler is reporting several thousand database queries as a result of negotiating the active site in the `processOutbound` method in the Drupal\micro_node\HttpKernel\MicroNodeOutboundPathProcessor, and is impacting site performance. The `$this->negotiator->getActiveSite()` seems to be called for every internal link that's rendered, including all admin links in the toolbar when logged in.

Steps to reproduce

Proposed resolution

Checking if the derived entity is an instance of NodeInterface before calling `getActiveSite()` seems to drastically reduce the number of queries ran on page load.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States k_a_l

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

Comments & Activities

Production build 0.69.0 2024