I have a performance problem using Symfony2 Form Component, I use this component to create a form containing 300 checkboxes. This form must be flexible (the flag must be created in the SET_DATA event using this data tree. I also use subscribers to make my form flexible.
Problem:
- Form generation took an average of 900 ms (which is a significant amount of time given the size of the input)
- Binding my form took much longer (average 1 sec)
Assumptions:
- The PathMapper property takes too long to create paths and look for the correct one to receive error messages during validation.
My question is:
- If you have a problem with PropertyPath, do you know how to fix it? If not, any ideas on how to optimize my form?
Our code:
I created github Gist> https://gist.github.com/2867617
- data.array is the data format we use to create our search form. (a tree can have many sub-levels and is created from our database)
- SearchType.php is our main type of search
- The other classes we use help us iterate and create all the elements of the search criteria.
PS: We are using Symphony2 version 2.0.15,
Thanks,
source share