Cache plugin instances for better performance

Created on 13 January 2023, over 1 year ago
Updated 24 January 2023, over 1 year 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 over 1 year ago
  • Status changed to Needs review over 1 year ago
  • e0ipso Can Picafort

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

  • Status changed to Fixed over 1 year ago
  • Status changed to Fixed over 1 year 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.69.0 2024