Speed up rendering of an icon

Created on 3 April 2023, over 1 year ago

Problem/Motivation

We have a form with several micon fields on it. This field is inside a paragraph, so it can be added multiple times. When adding another row, it takes a while before the row is added. Eventually, the web server will break off, because adding another row would take longer than the max execution time.

I have tried tracing this down and found that rendering the micon item is done quite often. After adding private variables (for the markup and json outputs), the total time of the request went from 25+ seconds down to 1 second.

There are more issues in our platform regarding to performance, and this was one of the improvements I found :)

Steps to reproduce

  • bonus initial step: have a big platform that is slow already :)
  • Add a multiple micon field to a node
  • Open the edit form of a node with a few items in the field
  • Add another row to the field

Proposed resolution

Add local caching of the markup and json output.

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇳🇱Netherlands spadxiii

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

Comments & Activities

  • Issue created by @spadxiii
  • @spadxiii opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇳🇱Netherlands spadxiii

    Created a merge request with the local caching vars.

  • 🇩🇪Germany Anybody Porta Westfalica

    @SpadXIII are you sure this really speeds things up? Do you have any statistics for that?
    Each PHP object is recreated, if it's not reused itself, so I guess in most cases this is not using the cached values?

    Still it would make sense to implement better caching, especially if icons are used several times on a page.
    I just think the implementation might not be the best possible solution?

  • 🇩🇪Germany Anybody Porta Westfalica
Production build 0.71.5 2024