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

Skip to content

[FrameworkBundle] Allow disabling dumping of container to XML to improve performance #49487

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
Feb 22, 2023

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Feb 22, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR

In debug mode, when the container is compiled, an XML file is automatically generated. This file is used by various commands like:

  • debug:container
  • lint:container
  • config:dump-reference
  • debug:autowiring
  • debug:router

But generating this file comes with a price. When your container grows, the XML file grows, and the time to compile this file increases.

In our large application this file became 20MB and took 2 seconds to generate every time the cache needed to be recompiled. For us, the benefit of this file does not outweigh the decrease in performance.

Therefore I'd like to disable this dumping and accept the consequences for less debug possibilities.

To disable this, one can set the debug.container.dump parameter to false.

@carsonbot carsonbot added this to the 6.3 milestone Feb 22, 2023
@ruudk ruudk changed the title Allow disabling container to XML to improve performance Allow disabling dumping of container to XML to improve performance Feb 22, 2023
In debug mode, when the container is compiled, an XML file is automatically generated. This file
is used by various commands like:
- `debug:container`
- `lint:container`
- `config:dump-reference`
- `debug:autowiring`
- `debug:router`

But generating this file comes with a price. When your container grows, the XML file grows, and the
time to compile this file increases.

In our large application this file became 20MB and took 2 seconds to generate every time the cache
needed to be recompiled. For us, the benefit of this file does not outweigh the decrease in
performance.

Therefore I'd like to disable this dumping and accept the consequences for less debug possibilities.

To disable this, one can set the `debug.container.dump` parameter to `false`.
@ruudk ruudk force-pushed the allow-disabling-xml-dumping branch from 9a32f69 to 467fb3d Compare February 22, 2023 09:40
@ruudk
Copy link
Contributor Author

ruudk commented Feb 22, 2023

Failing fabpot.io check is unrelated to this PR.

@carsonbot carsonbot changed the title Allow disabling dumping of container to XML to improve performance [FrameworkBundle] Allow disabling dumping of container to XML to improve performance Feb 22, 2023
@nicolas-grekas
Copy link
Member

Thank you @ruudk.

@chalasr
Copy link
Member

chalasr commented May 7, 2023

Note that this XML dump is also needed by Symfony plugin for PHPStorm for its DIC related features. It'd probably be worth listing the main known limitations this brings in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants