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

v1.7-8 performance: ProductController::assignAttributesCombinations() seems unused since v1.6 #36051

Open
2 tasks done
the-ge opened this issue Apr 29, 2024 · 2 comments · May be fixed by #36056
Open
2 tasks done

v1.7-8 performance: ProductController::assignAttributesCombinations() seems unused since v1.6 #36051

the-ge opened this issue Apr 29, 2024 · 2 comments · May be fixed by #36056
Labels
Bug Type: Bug CO Category: Core Combinations Product type: issue about products with combinations develop Branch NMI Status: issue needs more information Waiting for dev Status: action required, waiting for tech feedback

Comments

@the-ge
Copy link
Contributor

the-ge commented Apr 29, 2024

Prerequisites

Describe the bug and add attachments

The product page loads slower as the combinations count increase, which is normal. What's not normal is that most of the resources are consumed by the ProductController::assignAttributesCombinations() method, which assigns an array of attribute combinations (its size being the count of attributes x count of product combinations, i.e. 4 x 5000 in my case) as a Smarty template variable. Recent improvements directed at this are #34453 and #36039.

The thing is, this template variable seems to have been last used in PrestaShop v1.6.

So my question is: am I right in believing this method can be disposed altogether? I'd like to have some confirmations before starting a pull request.

The method is defined in lines 882-901 and called in line 381, in the develop branch version of /controllers/front/ProductController.php.

Expected behavior

I'd expect that template variable to be used somewhere. But if it can be disposed of, it means that the product page went all this time with the handbrake on, Rock Lee style.

Steps to reproduce

  1. The best way to test my assumption would be to run the testing suite included in PrestaShop, but I don't know how to do it without creating a pull request.
  2. One thing I've done is searching the Smarty template variable's name in PrestaShop's code. That's how I found out that it was last used in 1.6.
  3. Another thing I've done is commenting the method call and accessing the product page, which should've broken something, but apparently it didn't.

PrestaShop version(s) where the bug happened

1.7 to 9.0

PHP version(s) where the bug happened

Not relevant.

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

@the-ge the-ge added Bug Type: Bug New New issue not yet processed by QA labels Apr 29, 2024
@ChillCode
Copy link

ChillCode commented Apr 29, 2024

Well, seems you're right again, attributesCombinations & attribute_anchor_separator are never used, let's see.

Really nice catch I guess.

@ChillCode
Copy link

After one week I commented that line on a site with some products with almost 1000 combinations the LCP just improved by 0,4', GoogleBot is more happy now, thanks for the find.

@florine2623 florine2623 added develop Branch CO Category: Core Combinations Product type: issue about products with combinations Waiting for dev Status: action required, waiting for tech feedback NMI Status: issue needs more information and removed New New issue not yet processed by QA labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Type: Bug CO Category: Core Combinations Product type: issue about products with combinations develop Branch NMI Status: issue needs more information Waiting for dev Status: action required, waiting for tech feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants