Performance Issue on Ajax load on Inline Entity Form - Complex

Created on 3 May 2023, over 1 year ago
Updated 6 June 2024, 5 months ago

There is a performance issue in Inline Entity Form - Complex widget.

The edit/remove action starts getting slower as we start increasing the number of the reference entities.
Larger the number of reference entities slower the edit/remove operation.
In our case inside vocabulary, we are adding an unlimited reference entity of paragraph library items and we want to perform inline edit/remove operations for added reference entities, but the operation is too slow and impacting our site performance and editors/user experience.

Thanks in advance for any pointers you're able to provide.

🐛 Bug report
Status

Active

Component

Code

Created by

🇮🇳India Anul Delhi

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

Comments & Activities

  • Issue created by @Anul
  • 🇬🇧United Kingdom danharper

    I'm having the same issue, I'm trying to think of ways around using IEF as the original use case is a handful of entities where I have over 2500. Did you find a resolution ?

  • 🇮🇳India kalpanajaiswal

    Here is the thing.
    If you look in to the file "inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php"
    Inside function "formElement"
    A piece of code written to call the theme hook for each referenced entity.

    $element['entities'] = [
          '#tree' => TRUE,
          '#theme' => 'inline_entity_form_entity_table',
          '#entity_type' => $target_type,
    ];
    

    For example if we have 1000 reference entity, this theme hook be called 1000 times and due to this process is gets slow.

    Just remove the '#theme' attribute and test the functionality.
    UI will be broken as theme is not there but process will me much faster.

    We faced the same issue and remove the '#theme' and handled broken UI separately

    I am adding a screenshot for help.
    I have just run a test with 25 reference entity, so there is nut much difference in loading time, but if you test this with more entity reference content like 200 or 300, you will see a huge difference.

Production build 0.71.5 2024