-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Greatly improve performance by caching subsequent glob calls #33998
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
Greatly improve performance by caching subsequent glob calls #33998
Conversation
Hi @thlassche, thank you for your contribution! |
Hi @thlassche. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Co-authored-by: Ihor Sviziev <[email protected]>
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
It might significantly improve performance not only on dockerized environments but also on the ec2 instances or any server using network file storage as magento storage. |
Hi @andrewbess, thank you for the review.
|
Hi @ihor-sviziev, thank you for the review.
|
I think we don't need to cover it with any test as it will be not so easy. |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
What do you mean by "magento storage"? You mean "media storage"? @ihor-sviziev |
@onlinebizsoft, I think it's not only media folder, but also where magento code is located. |
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.
Hello @thlassche,
Some tests are failing for e.g. Functional Tests B2B, Functional Tests CE, Functional Tests EE. Please look into this.
@engcom-Hotel, the service that responsible for the currency API doesn't work. Here is confirmation: #34021 (comment) |
Interesting! Im not sure how glob is used and called in Magento. I thought Magento files would be loaded in OPcache memory already |
Thanks for the clarification @ihor-sviziev |
✔️ QA Passed Hello @thlassche, Thanks for the contribution! Preconditions Manual testing scenario
|
Just reduce few ms?!! |
It depends a lot on what is currently in the cache and what is not. The first load of uncached pages will benefit way more. |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all test |
Failed to run the builds. Please try to re-run them later. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Description (*)
This pull request introduces an in-memory cache for glob system calls. On systems where file I/O is slow (for example Docker for Mac), glob system calls can be quite slow. This pull requests caches the same glob calls and returns a cached result if possible. In my testing this reduced the glob calls on the category listings from ~8K to ~1.6K.
Blackfire comparison:
Related Pull Requests
None
Fixed Issues (if relevant)
None
Manual testing scenarios (*)
glob()
callsQuestions or comments
Contribution checklist (*)
Resolved issues:
Resolved issues: