-
Couldn't load subscription status.
- Fork 9.4k
#40216-Replacing nested foreach with array union (+) to reduce time complexity #40217
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
base: 2.4-develop
Are you sure you want to change the base?
#40216-Replacing nested foreach with array union (+) to reduce time complexity #40217
Conversation
|
Hi @senthilengg. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
Failed to run the builds. Please try to re-run them later. |
|
@magento run unit Tests |
|
@magento run Database Compare,Functional Tests CE,Functional Tests EE,Functional Tests B2B,Integration Tests,Magento Health Index,Sample Data Tests CE,Sample Data Tests EE,Sample Data Tests B2B,Static Tests,WebAPI Tests,Semantic Version Checker |
|
@magento run Functional Tests CE,Static Tests,WebAPI Tests |
|
@magento run Functional Tests EE,Functional Tests B2B,Integration Tests |
…left array untouched
|
@magento run Functional Tests CE |
|
@magento run WebAPI Tests |
|
@magento run WebAPI Tests |
|
@magento run WebAPI Tests |
|
@magento run all tests |
|
@magento run all tests |
…cate _setItemAttributeValue
|
@magento run Unit Tests, WebAPI Tests, Static Tests |
|
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @senthilengg for making the changes.
Failed tests seems flaky to me, hence approving this PR.
Remove unnecessary blank line at the beginning of the file.
|
@magento run all tests |
|
Hi @senthilengg ✔️ QA Passed Preconditions: Manual testing scenarios
Count 32 Count 1 Builds are failed. Hence, moving this PR to Extended Testing. Thanks. |
|
@magento run Functional Tests B2B, Functional Tests EE, Static Tests |
|
@magento run all tests |
|
@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE |
|
@magento run Functional Tests B2B, Functional Tests EE |






Description (*)
[product_id => [attribute_code => value, attribute_code1 => value1]]_setItemAttributeValueonly once per$selectGroupsinstead of per$selectGroups, per attribute and per productFixed Issues (if relevant)
Manual testing scenarios (*)
Result
Without this PR - Too many calls to _setItemAttributeValue function

With PR - Only one call to _setItemAttributeValue function

Additional Questions
Since array_replace is memory intensive for large array would it benefit over all or not ?
array union (+) seems to be memory optimised and used here