Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tweak configuration for app.yaml #65

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
May 20, 2017
Merged

Tweak configuration for app.yaml #65

merged 1 commit into from
May 20, 2017

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented May 14, 2017

symfony-bot
symfony-bot previously approved these changes May 14, 2017
resource: '../../src/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
exclude: '../../src/{Entity,Repository}'
Copy link
Member

Choose a reason for hiding this comment

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

What about excluding Controller too (see symfony/symfony-standard#1070 (comment))?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented May 16, 2017

Just to make things consciously: this will load+track all classes in src/ to build the container.
Any (signature-related) changes to any of them will invalidate the container + every class will be loaded for every single request to check if something changed (using the code in ReflectionClassResource.)

@fabpot
Copy link
Member Author

fabpot commented May 16, 2017

@nicolas-grekas That's indeed a good point and why we add a list of specific directories before. We made the same change in Symfony SE, so we need to decide between DX and performance here. /cc @weaverryan

@GuilhemN
Copy link
Contributor

I don't think that's a big deal, generally all classes in src/ are used either as services or during the compilation so imo unwanted invalidation should not happen often.
At worse if that becomes a big deal, that's because that's a big application so its admin should know he has to tweak his config to improve perf.

Here I think dx clearly wins, moreover the perf loss is only during compilation.

@stof
Copy link
Member

stof commented May 16, 2017

thus, if you end up whitelisting most folders in src instead of adding everything and excluding some folders, you get exactly the same classes being registered as ReflectionClassResource.
So the question here is not how many resources you have. It is whether it is easier to write a whitelist or a blacklist to build the list of folders being registered.

@weaverryan
Copy link
Member

I'm also aware of this tracking issue - and it was on my list for the future to fix, because I think it's a bug. Specifically, if we remove a private service (because it's unused), then we could/should be smart enough to remove its ReflectionClassResource. It's just a matter of coding up that fix. If we think it's a critical bug, we could add it in time for the 3.3 release.

I think we should keep just {Entity,Repository}... we don't know for sure of any other directories that should definitely not be tracked. And no matter what, there will probably be a few opportunities/needs to improve the resource tracking further.

@nicolas-grekas
Copy link
Member

if we remove a private service (because it's unused), then we could/should be smart enough to remove its ReflectionClassResource

False assumption: just add an interface on one of them, and autoconfig might add it as eg an event subscriber. This will happen in the dev cycle of many. The current behavior is just accurate to me, no bug.

@weaverryan
Copy link
Member

@nicolas-grekas you're correct - if we don't track a class and then someone adds an autoconfigurable interface, the container wouldn't rebuild.

I still think we should keep only {Entity,Repository}. And then we can see how this works in the wild. I can add a note in the docs about dev performance considerations. The new features - including autowiring - will naturally be a bit more aggressive on rebuilding your cache, which might be a problem in REALLY big projects.

@nicolas-grekas
Copy link
Member

Let's try, +1 :)

@fabpot fabpot merged commit 7581f44 into master May 20, 2017
fabpot added a commit that referenced this pull request May 20, 2017
This PR was merged into the master branch.

Discussion
----------

Tweak configuration for app.yaml

symfony/symfony-standard#1070

Commits
-------

7581f44 tweaked configuration for app.yaml
@xabbuh xabbuh deleted the app-yaml-tweaks branch May 20, 2017 07:38
VolCh pushed a commit to VolCh/recipes that referenced this pull request Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants