Hello All,

I'm requesting some support in order to find out if performance optimizations are possible here.

I have a Drupal site that uses Commerce and IEF to provide a customized interface for Backend orders creation and edition.

The main issue I'm having now is related to the speed elements are taking to load on the page.

1. Orders with many line items (over 100) takes up to 4 seconds to show the edit page
2. Orders with many line items takes up to 30 seconds to save
but those issues might be related to the commerce and/or the server configuration

One of the top disturbing speed issue is on the open speed of Line items edit form.

For each click on a line items edit/add a very regular 8 seconds have to be waited....
One of the biggest order contains 160 line items... it took more than 20 minutes in waiting time to create.

The line item type is custom and contains 19 custom fields, my objective would be to reduce this to under a second but any help, direction even solution would be most welcomed.

If you have any question or need to have some information about the Drupal instance this runs on, feel free to ask.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Title: Line Item Edit Response Time » Don't put loaded entities into form state needlessly
Category: support » bug
Status: Active » Needs review
FileSize
7.26 KB

An order with that many line items will always have a performance penalty because each line item needs to be loaded in order to be displayed.
Still, the numbers you're seeing are excessive.
xhprof will be the best way to profile this.

But before you do that, please apply the attached patch and retry your tests, tell me how it affects your measurements.
IEF is currently storing all those entities in form state for no good reason, which must affect the speed of form loading.
This patch fixes that.

EDIT: Basically, the save speed is related to your server. The load speed is something we can try and optimize.

bojanz’s picture

@JulienF
Any chances you could test this?
I can't commit it otherwise.

JulienF’s picture

Status: Needs review » Reviewed & tested by the community

Sorry for the late reply,

I'm running out of time lately, I did try it and it works just well but I'm not experiencing noticeable differences on the speed side.

I'm awaiting for another server to be delivered to me and make some tests on that fresh server to see how would that impact it.

On the hosting side do you have any particular suggestion ?

Thanks,

bojanz’s picture

Okay, thanks.
This is all I could do.
You need to fire up xhprof and find the bottlenecks yourself.

bojanz’s picture

Status: Reviewed & tested by the community » Needs review

I'm not going to commit a patch with changes this big without proof it actually improves anything.
Setting back to "needs review".

bojanz’s picture

Issue summary: View changes
FileSize
6.78 KB

Reroll.

almc’s picture

I wasn't able to apply the patch to inline_entity_form.module for the module version 7.x-1.5: "The patch can't be applied in the selected context".

bojanz’s picture

Status: Needs review » Closed (won't fix)

Decided not to do this. It's too late in the module's release cycle and there's no indication that the change actually helps.

lunatic’s picture

hi,

I came across this issue yesterday while searching for causes that made the node edit form of one of the project content types

In our use case we have :

- a unlimited entity reference field attached to a content type
- that uses inline_entity_form widget to create references to an intermediate custom entity
- that it then references other content types plus some additional fields (4 text fields)

Some stats :

- 500.000+ of nodes
- 200.000+ of custom entities

Tests on development enviroments :

By applying this patch the ajax request that is fired when choosing "add more" went down from 5+ seconds to 2,1-2,5 seconds

This is true for both adding new nodes and an initially empty field as well as editing existing nodes with several items (referenced entities) already in the field.