Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Performance] Slow product edit page with big amount of custom options #29409

Closed
1 of 5 tasks
ihor-sviziev opened this issue Aug 5, 2020 · 28 comments · Fixed by #37477
Closed
1 of 5 tasks

[Performance] Slow product edit page with big amount of custom options #29409

ihor-sviziev opened this issue Aug 5, 2020 · 28 comments · Fixed by #37477
Assignees
Labels
Area: Performance Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.3.5-p2 Indicates original Magento version for the Issue report. Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Performance

Comments

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Aug 5, 2020

Preconditions (*)

  1. Magento 2.3.5-p2 or 2.4-develop

Steps to reproduce (*)

  1. Create simple product OR import following file:
    export_catalog_product_20200805_133448.zip
  • Add 8 custom options, each of them with option type "Drop-Down", values - 12 month names (Jan - Dec)
    image
    image
  • Save the product
  1. Open "Cusomizable options" section

Expected result (*)

  1. Browser should load custom options quite fast, 1-2 seconds.

Actual result (*)

  1. Browser becomes really crazy with high CPU load, it loads just this section for at least 5 seconds and whole page is quite slow during load.

Here is performance profile from Google Chrome extension:
Profile-20200805T162549.zip

Use case

We would like to provide our customers an ability to customize amount and colors of stones on the product (up to 8 stones, in example each color named as month for simplicity of example).


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 5, 2020

Hi @ihor-sviziev. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 5, 2020
@ghost ghost added this to Ready for QA in Community Backlog Aug 5, 2020
@sdzhepa sdzhepa added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Triage: Performance labels Aug 17, 2020
@ihor-sviziev
Copy link
Contributor Author

Seems like following commit might also improve performance for the custom options: 05fce8b
@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, here is your Magento instance.
Admin access: https://i-29409-2-4-develop.instances.magento-community.engineering/admin_43de
Login: 46f2383a Password: 2877f23b4396
Instance will be terminated in up to 3 hours.

@ihor-sviziev
Copy link
Contributor Author

Just checked - unfortunately it's not fixed the issue

@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 24, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 20, 2020
@ghost ghost removed this from Ready for QA in Community Backlog Oct 20, 2020
@ghost ghost removed this from Ready for Grooming in Low Priority Backlog Oct 20, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 20, 2020
@ihor-sviziev ihor-sviziev added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Oct 29, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.3.5-p2 Indicates original Magento version for the Issue report. label Nov 13, 2020
@stale
Copy link

stale bot commented Jan 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label Jan 29, 2021
@ihor-sviziev
Copy link
Contributor Author

Still actual

@stale stale bot removed the stale issue label Jan 29, 2021
@engcom-Delta engcom-Delta self-assigned this Jan 29, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 29, 2021

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta engcom-Delta added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it labels Jan 29, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Jan 29, 2021
@Nuranto
Copy link
Contributor

Nuranto commented Sep 23, 2022

If someone is brave enough to dig in, I guess that a start would be to replace Array functions, especially in dom-observer.js

See https://leanylabs.com/blog/js-forEach-map-reduce-vs-for-for_of/

@mariogobos
Copy link

Hello, i've same problem on my magento 2.4.4 my product have 1500 custom options and load time is 7sec. Do you have find a solution? Thanks a lot

@densen45
Copy link
Contributor

densen45 commented May 8, 2023

I have the same problem with the Bundle Product edit page. As @pmonosolo described, the more options and selections a Bundle has, the more time it takes to load the page.

As @Nuranto suggested, I replaced all the forEach Array functions with for...of in the dom-observer.js.
E.g.

nodes.forEach(function (node) {
    result.push(node);

    children = extractChildren(node);
    result = result.concat(children);
});

becomes

for (const node of nodes) {
    result.push(node);

    children = extractChildren(node);
    result = result.concat(children);
}

But what really does the trick for me, was to get rid of all the concat calls in the dom-observer.js.
E.g. in the above example

result = result.concat(children);

becomes

result.push(...children);

With these simple changes I was able to decrease the page load time for one of my Bundle Products from about 1min 20sec to 35sec.

I'd be interested to know if these changes also improve page load time for products with custom options (I don't have any of those).

@ihor-sviziev
Copy link
Contributor Author

@densen45, could you please create a Pull Request with your changes? So that we can run automated tests on top of them

@densen45
Copy link
Contributor

densen45 commented May 9, 2023

@magento I am working on this

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in Low Priority Backlog May 9, 2023
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in Low Priority Backlog May 9, 2023
@engcom-Lima engcom-Lima added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Ui Reported on 2.4.x Indicates original Magento version for the Issue report. Area: Performance and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 11, 2023
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-9127 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Jul 11, 2023

✅ Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Performance Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.3.5-p2 Indicates original Magento version for the Issue report. Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Performance
Projects
Development

Successfully merging a pull request may close this issue.