Skip to content

Unnecessary recalculation of product list pricing causes huge slowdowns #14941

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

Closed
paales opened this issue May 2, 2018 · 3 comments
Closed
Assignees
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Partner: Reach Digital Pull Request is created by partner Reach Digital up for grabs

Comments

@paales
Copy link
Contributor

paales commented May 2, 2018

Preconditions

  1. 2.2.2
  2. PHP 7.0, MySQL 5.6

Steps to reproduce

  1. Create a catalog where prices are including tax + prices are shown including tax.
  2. Go to a category page and show 100 products per page.

Expected result

  1. System does price calculation very efficiently

Actual result

  1. It recalculates the tax while it shouldn't be doing that.

schermafbeelding 2018-05-02 om 14 24 14-1

If we can disable the recalculation of tax we get the following result:
slack-imgs

Please note that this is with xdebug enabled, so overal performance is bad over here, but the percentual difference is present with xdebug disabled.

The problem seems to lie in the following method:

case self::DISPLAY_TYPE_INCLUDING_TAX:
$res = true;
break;

The highlighted line should be false. If we fix that line the calculation time for the price template goes from 4.3 seconds to 1.6 seconds. This means a 2.7 seconds performance improvement.

In the last chart you can still see room for improvement as the final_price.phtml tempalte still takes 31% of total page load time, while I would expect this to be a lot less. So investigating further still.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 2, 2018
@paales paales added the Partner: Reach Digital Pull Request is created by partner Reach Digital label May 8, 2018
@magento-engcom-team
Copy link
Contributor

Hi @paales. Thank you for your report.
The issue has been fixed in #15089 by @JeroenVanLeusden in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.5 release.

@ishakhsuvarov
Copy link
Contributor

Hi @paales. Thank you for your report.
The issue has been fixed in #15445 by @JeroenVanLeusden in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@ishakhsuvarov ishakhsuvarov added the Fixed in 2.1.x The issue has been fixed in 2.1 release line label May 31, 2018
@JeroenVanLeusden JeroenVanLeusden self-assigned this Jun 1, 2018
@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jun 1, 2018
@magento-engcom-team
Copy link
Contributor

Hi @paales. Thank you for your report.
The issue has been fixed in #15200 by @JeroenVanLeusden in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Partner: Reach Digital Pull Request is created by partner Reach Digital up for grabs
Projects
None yet
Development

No branches or pull requests

4 participants