-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[2.2.4][Performance][Listing][CE/EE] Too much product collection loads #15001
Comments
@IgorVitol are you going to create a PR for this? |
@thiagolima-bm Hi! For now I have no free time to make such changes. So I decided at least to report this here. |
@IgorVitol, thank you for your report. |
It looks like this has already been fixed 59c0e31#diff-e737458adb2a6eb7bd565d7bf7d9d91aR47 |
It would make sense to to resolve the pricing on in the collection itself since it already contains simple products. |
@magento give me 2.3-develop instance |
Hi @IgorVitol. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @IgorVitol, here is your Magento instance. |
✅ Jira issue https://jira.corp.magento.com/browse/AC-1024 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
Preconditions
Steps to reproduce
Magento\Catalog\Model\ResourceModel\Product\Collection::_afterLoad()
catalog_product_collection_load_after
event.It can be very simple & dirty logging, since our objective here is only to fetch amount of collection loads:
\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->critical('product collection loaded!');
Expected result
Actual result
After some investigation, I noted that here is specific method, which loaded child product collection for each separate configurable product on the listing page:
Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProvider::getProducts(ProductInterface $product)
It's code - http://prntscr.com/jdsxq8
This method called from next places:
Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox::hasSpecialPrice
Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver::resolvePrice
Magento\ConfigurableProduct\Plugin\Catalog\Model\Product\Pricing\Renderer\SalableResolver::afterIsSalable
This looks strange, because first two places seems like already covered by price-index (?), and last one (afterIsSalable) just checks if here is some children available - this definitely can be handled in backend (e.g. we can index such things, disable/move to our/of stock parent if all children are not available, e.t.c.).
In result, here should be only 1 collection call, which will improve general listing page load performance. Especially if you plan to display many products on the page.
The text was updated successfully, but these errors were encountered: