Cache plugin instances for better performance

Created on 13 January 2023, almost 2 years ago
Updated 24 January 2023, almost 2 years ago

Problem/Motivation

When rendering complex sites, with a lot of components, especially with components that inherit each other over multiple levels, the rendering itself gets very slow. It seems it gets exponentially slower with each level of inheritance / embedding.

Steps to reproduce

Build 3 components that build on top of each other and render a lot of them. When we compare the render time of using the direct name of the component in the embed / include (so cl_components resolves the component and does its magic) it is painfully slow in comparison to loading the direct path of the twig file or the component via the components module (with "@modulename/path/to/twigfile").

Proposed resolution

Cache Plugin instances, because it seems that they get created on the fly for each call to a component and that creates a big performance hit.

Remaining tasks

Create issue fork / proposed resolution (Harlor has a POC we created together when we were debugging the performance of our project)

User interface changes

None

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany fisherman90 Dortmund

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.

  • Status changed to Needs work almost 2 years ago
  • Status changed to Needs review almost 2 years ago
  • e0ipso Can Picafort

    This looks good! Thanks for addressing the feedback. Merging and releasing.

  • Status changed to Fixed almost 2 years ago
  • Status changed to Fixed almost 2 years ago
  • 🇩🇪Germany fisherman90 Dortmund

    Thanks a lot for giving such qualitative and constructive feedback :D
    Learned something new through it, very appreciated.

    Also thanks to anyone else involved - pleasure working with you :)

Production build 0.71.5 2024