Problem/Motivation

With #3610009: Stop discovery of hooks in include files, we stopped looking at .inc files. In #3618181: Findings from profiling a full cache clear on a relatively large site, I noticed significant overhead from the directory traversing part, this is partially improved now, but we could improve it further by explicitly only looking at .module/.theme files and only process the src/Hook folder with the iterator.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3618955

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

berdir created an issue. See original summary.

berdir’s picture

Title: Reduce necessary file traversing in HookCollectorPass » Reduce necessary directory traversing in HookCollectorPass

longwave-bot made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.08 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nicxvan’s picture

Maybe this is a good time to unify the HookCollectorPass and ThemeHookCollectorPass directory traversal?

longwave’s picture

Status: Needs work » Needs review

Added a base class and moved the shared code for both passed into there.

berdir’s picture

I like this. it will conflict with #3574003: Properly include install files for install hook_requirements, but we're still discussing there and that's easy enough to resolve.

Just one question on the MR, not sure what our policy is these days on docblocks of test methods?

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the reply.

I think this is good then. This is main only, backport not possible as 11.x still needs to scan everything to look for include files.

And nice to have a start of a base class between the two. We originally decided against it as there was little that could be shared, but it's starting to converge and will more I guess, as .module/.theme and other BC layers will go away in D13.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 7d62c7b7785 to main. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 7d62c7b7 on main
    task: #3618955 Reduce necessary directory traversing in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.