Skip to content

Stop the profiler when returning early in \Magento\Eav\Model\Config::getAttribute #12810

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

Merged
merged 1 commit into from
Dec 22, 2017

Conversation

nicka101
Copy link
Contributor

Magento\Eav\Model\Config::getAttribute doesn't stop the Profiler when returning early, and thus incorrectly reports run time in these cases.
This pull fixes it by stopping the profiler before returning

Manual testing scenarios

  1. In an unmodified Magento 2.2 codebase, enable profiling (I used mirasvit/profiler for convenience)
  2. Make a request for a page and observe that a large number of EAV getAttribute calls have run times
    similar to the entire response time of the page.
  3. Repeat with this pull request and see that the run times are reported more accurately

Magento\Eav\Model\Config::getAttribute doesn't stop the Profiler when returning early, and thus incorrectly reports run time in these cases. 
Fix it by stopping the profiler before return
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Dec 19, 2017

CLA assistant check
All committers have signed the CLA.

@dmanners dmanners self-assigned this Dec 19, 2017
@dmanners dmanners added this to the December 2017 milestone Dec 19, 2017
@dmanners
Copy link
Contributor

Thanks for the PR @nicka101 I will start to process this and keep you updated if I need any more information.

@magento-team magento-team merged commit 5f1b846 into magento:2.2-develop Dec 22, 2017
magento-team pushed a commit that referenced this pull request Dec 22, 2017
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.

4 participants