content_translation_entity_extra_field_info() is very expensive on cache rebuilds

Created on 26 April 2024, about 2 months ago
Updated 28 April 2024, about 2 months ago

Problem/Motivation

Profiling a site with content_translation module enabled, and while it might be compounded other issues the request immediately after a drush cr leads to 73,000 calls to content_translation_entity_extra_field_info(), which takes around 20 seconds.

There are at least two possible issues:

1. ContentTranslationManager::isEnabled() has no static cache. It also doesn't do any multiple load for bundles
2. ContentTranslationManager::loadContentLanguageSettings() tries to load a config entity, but if it doesn't get one, it creates a stub. This means if there's no config entity it will be repeatedly creating the stub. I didn't check yet but also wondered if we even cache config entity load misses, if we don't it'll be hitting the database every time.

This seems like a good candidate for a cache collector in general.

Sufficiently bad to make a site with lots of bundles unresponsive so opening as a major bug report.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Config translationΒ  β†’

Last updated about 1 month ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Comments & Activities

Production build 0.69.0 2024