Skip to content

Conversation

andrey-legayev
Copy link
Contributor

Description (*)

I've run DI Compile process under XDebug Profiler to find a way to speed it up.
I've prepared several changes which result in 9-10% of speed improvement (according to my benchmarks).

List of changes:

  • move array_merge() out of loop
  • get rid of in_array usage
  • optimize string concatenation
  • use '===' instead of '=='

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Run DI compile on base branch then copy folder "generated/" to "generated-old/"
  2. Run DI compile on this branch then copy folder "generated/" to "generated-new/"
  3. Compare folders. You should not see diff in generated code.

Questions or comments

N/A

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)
  • All automated tests passed successfully (all builds are green)

General performance optimizations in DI Compile:

 - move array_merge() out of loop
 - get rid of in_array usage
 - optimize string concatenation
 - use '===' instead of '=='
@m2-assistant
Copy link

m2-assistant bot commented Oct 7, 2019

Hi @andrey-legayev. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@ihor-sviziev ihor-sviziev self-assigned this Oct 8, 2019
@ihor-sviziev ihor-sviziev added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: complex labels Oct 8, 2019
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-6045 has been created to process this Pull Request

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2019

Hi @andrey-legayev, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team merged commit 5b57986 into magento:2.3-develop Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants