-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Memory usage on Symfony Form #29055
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
Comments
Do you the symfony frameworkbundle with it's form caching? Or a custom integration of the form component? |
I use symfony framework, not custom integration. But even if I use without the framework:
Every field uses about 5.4 KB |
I don't think there is much we can do. The Form component is complex due to how forms can be built, extended and modified. This does not mean that there isn't room for improvement, but on a first glance the numbers you have here don't look too bad. |
…s (yceruto) This PR was merged into the 4.2-dev branch. Discussion ---------- [OptionsResolver] Micro optimizations and simplifications | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29055 | License | MIT | Doc PR | - As we know, this component has a big impact on the workflow of the `Form` component. I'm a newcomer in Blackfire, so there could be other optimizations that I can't able to see, but here we go. For now, we've less code to maintain  and a micro-optimizacion of performance. It'd be great if someone could try these changes in a real project to see their real value.   https://blackfire.io/profiles/compare/a04a13d3-7f60-4434-a2b8-0762efb8fbd6/graph https://github.com/yceruto/orbf The sample takes into account only the core extensions. Cheers! Commits ------- 24c2213 Optimizations and simplifications OMG Blackfire!
@alexey-okhorzin did #29065 help? |
Let's close here as there is no ad-hoc solution, but we can always consider to improve parts of the framework if someone proposes a more performant solution. |
Hello. How to reduce the memory usage on Symfony Form?
A form can use more then 128 MB, if I build a form with many fields and then render its. For example a form with 500 fields (a form with multiple embedded forms). Such form uses about 12 MB.
Every invoke the add method of the FormBuilder class uses about 16KB.
The text was updated successfully, but these errors were encountered: