Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Config][DependencyInjection] Optimize dumped resources for tracking#57948

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:7.2fromnicolas-grekas:config-res
Aug 13, 2024

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedAug 8, 2024
edited
Loading

QA
Branch?7.2
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

Looking at the resource tracking cache, I figured out we could remove tracking some more resources.

On a webapp skeleton, this goes from 85 to 39 resources to track.

On my Ubuntu, I couldn't measure a difference, but on slow filesystems (Windows, shared mounts), I hope this might improve the DX a bit during dev. Anyone able to confirm?

Koc reacted with rocket emoji
@xabbuh
Copy link
Member

The failures look related to the changes.

@nicolas-grekasnicolas-grekasforce-pushed theconfig-res branch 2 times, most recently from9fa19e3 toa29fb1eCompareAugust 12, 2024 10:13
@nicolas-grekas
Copy link
MemberAuthor

The failures look related to the changes.

Yep, fixed

@nicolas-grekasnicolas-grekasforce-pushed theconfig-res branch 3 times, most recently from4b3dc48 to07d646dCompareAugust 12, 2024 12:27
@nicolas-grekasnicolas-grekas merged commit5df2af1 intosymfony:7.2Aug 13, 2024
@nicolas-grekasnicolas-grekas deleted the config-res branchAugust 13, 2024 10:08
nicolas-grekas added a commit that referenced this pull requestAug 30, 2024
… on cache clear, impossible to install new project (eltharin)This PR was merged into the 7.2 branch.Discussion----------[DependencyInjection] Fix bug on windows, memory exhausted on cache clear, impossible to install new project| Q             | A| ------------- | ---| Branch?       | 7.2| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | Fix| License       | MITSince#57948 on windows, I can't make a cache clear with a fatal error form memory exhausted or install a new symfony app.Xdebug saw an infinite loop.Correction with DIRECTORY_SEPARATOR constant instead /Commits-------89b4c87 bug correction
continue;
}

if (!$inVendor =$this->inVendors($dir)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This logic looks wrong to me. Configuring a namespace prefixed to match a given directory does not mean that all classes matching that prefix must be defined in that folder.
For instance, all our mailer bridges have a namespace prefix that can also be matched by the prefix of thesymfony/mailer package. And nothing prevents the project-level code to also define classes with that namespace (best practices is to keep your project-level code in a different namespace than your vendors, but that's not a requirement, and I know some projects do weird things).

For existing classes, we can optimize the class existence resource if the class is defined in the vendor folder (by checking the actual class definition, not folders in which it ismaybe defined). For non-existent classes, we should not optimize the resource (or we should optimize it only based onall possible autoloading locations)

@GromNaN
Copy link
Member

I figured out we could remove tracking some more resources.

After reading the code, I don't understand which new classes are excluded.

nicolas-grekas added a commit that referenced this pull requestSep 3, 2025
…peMC)This PR was merged into the 7.3 branch.Discussion----------[Config] Fix `ReflectionClassResource` hash validation| Q             | A| ------------- | ---| Branch?       | 7.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITIt looks like#57948 broke hash validation.The problem is that `$excludedVendors` is now used to generate the hash but is not serialized. After unserialization, the property is empty, so the generated hash never matches the dumped one.Commits-------cec2f00 [Config] Fix `ReflectionClassResource` hash validation
@stof
Copy link
Member

stof commentedSep 3, 2025

@GromNaN this is about skipping FileResource, DirectoryResource, FileExistenceResource and ClassExistenceResource for resources that are in thevendor folder (similar to howGlobResource was already skipped), as we have a FileResource checking thevendor/composer/installed.json file, which will be invalidated any time you change the installed packages with composer.

This is all based on the assumption that you don't edit manually files in thevendor folder. But as this is only aboutautomatically invalidating the cache, this assumption is fine. You can clear the cache manually if you do weird things with your vendor folder.

GromNaN reacted with thumbs up emoji

nicolas-grekas added a commit that referenced this pull requestSep 3, 2025
…e (nicolas-grekas)This PR was merged into the 7.3 branch.Discussion----------[DependencyInjection] Fix optimizing ClassExistenceResource| Q             | A| ------------- | ---| Branch?       | 7.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITPer `@stof` review at#57948 (review)Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/61615/files?w=1).Commits-------b7ca948 [DependencyInjection] Fix optimizing ClassExistenceResource
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.2

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@xabbuh@GromNaN@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp