Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291711

Pages with multiple instances on CKEditor 5 are unnecessary slow

$
0
0

Problem/Motivation

Pages where multiple editor instances are loaded would benefit from static caching. Currently, Drupal\editor\Plugin\EditorManager::getAttachments() is called for every editor instance, which is inefficient, avoidable, and results in slow page load times if more than a few editor instances are loaded.

A real-world example would be a node edit page with a number of CKEditor 5-enabled fields. This is actually fairly common on sites build with Paragraphs.

Steps to reproduce

  1. Install vanilla Drupal with the 'Standard' install profile.
  2. Modify the Body field on the Article content type to allow unlimited values.
  3. Create an Article node with 20 values for the Body field.

Proposed resolution

  • On the EditorManager class, add an $attachments property and an $editorsproperty.
  • In the ::getAttachments method, refactor the code to cache editors and attachments such that editor_load() is only called once per editor.

Remaining tasks

  1. Open MR
  2. Code review
  3. Merge

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.

Original Issue Summary

We have nodes with paragraphs which contain ckeditor 5 instances.
Now i know i could load the paragraphs in a closed state but this is not what we're doing.

We're currently optimizing the author performance and benchmark the application with Blackfire and saw that a lot of code is executed for each instance of Ckeditor which i think we should be able to cache for each text editor format?

See the attachments of the timeline and the zoom into the getAttachments functions which i think we should be able to statically cache for each text editor format?


Viewing all articles
Browse latest Browse all 291711

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>