Skip to content

[Issue] Greatly improve performance by caching subsequent glob calls #34025

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #33998: Greatly improve performance by caching subsequent glob calls


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:

Screenshot 2021-09-06 at 09 51 21

Related Pull Requests

None

Fixed Issues (if relevant)

None

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Profile any page before this diff is applied
  2. Apply diff and reprofile
  3. See a reduction in glob() calls

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)

Resolved issues:

  1. resolves [Issue] Greatly improve performance by caching subsequent glob calls #34024: Greatly improve performance by caching subsequent glob calls

Metadata

Metadata

Assignees

Labels

Area: FrameworkComponent: FilesystemFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions