magento2
magento2 copied to clipboard
magento/magento2#39948: Magento_Persistent performance overhead on non-cart, non-checkout pages
- new QuoteResourceWrapper class that uses direct SQL queries instead of loading the entire quote object, which should improve performance
Description (*)
I decided to test the solution proposed by the author. It turned out that the changes reduced the execution time of CheckExpirePersistentQuoteObserver from ~52ms to less than 1ms.
Before
After
So I make this pull request to initiate further discussion.
Related Pull Requests
Fixed Issues (if relevant)
- Fixes https://github.com/magento/magento2/issues/39948
Manual testing scenarios (*)
- Add product to cart (for example from PLP)
- Enter PDP with profiler enabled
Questions or comments
Contribution checklist (*)
- [ ] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Hi @KrasnoshchokBohdan. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment. :exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EEFunctional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento run all tests
@magento run all tests
@magento run Static Tests
@magento run Database Compare, Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests, Magento Health Index, Sample Data Tests B2B, Sample Data Tests CE, Sample Data Tests EE, Semantic Version Checker, Unit Tests, WebAPI Tests
@magento run all tests
@magento run all tests
@magento run all tests
@magento run all tests
@KrasnoshchokBohdan Thank you for contribution & collaboration!
✔️ QA Passsed
Preconditions:
- Install fresh 2.4-develop
- Install any profiling tool such as php-spx
Steps to reproduce:
- Add product to cart from PLP
- Go to the PDP page keeping profiler enabled
- verified on two different PDP
Before: ❌
After: ✔️
I observed significant improvement in execution time. Previously, the operation took approximately 42ms-43ms, and after the PR changes, it took 1ms-2ms for CheckExpirePersistentQuoteObserver::execute.
The builds are failed hence moving this PR in Extended Testing.
@magento run Functional Tests B2B, Functional Tests CE
The Functional B2B Tests failures in the last two consecutive builds are not consistent. They neither failing because of the code changes done in this PR nor part of this PR.
Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39967/9f8d6c4fa147eb34fae7d2ddc8cc3355/Functional/allure-report-b2b/index.html#categories/bdbf199525818fae7a8651db9eafe741
Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39967/223a2577e7607f816b69bcdc77ec64dd/Functional/allure-report-b2b/index.html#categories/bdbf199525818fae7a8651db9eafe741
Hence moving this PR in Merge In Progress.