Skip to content
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

allow cache even if a closure get used for query_builder #13570

Closed
wants to merge 2 commits into from
Closed

allow cache even if a closure get used for query_builder #13570

wants to merge 2 commits into from

Conversation

dominikzogg
Copy link

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Using entity types within a collection, can get very slow, if a query_builder option is set.

Without this option, the doctrine type handles everything itself, and makes it calls against the manager registry, but using this, calls the getLoader method, which ends in build the choice list again for each collection element, which makes more than twice the time for a page load within my energycalculator.

https://github.com/dominikzogg/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L68

https://github.com/dominikzogg/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L108

https://github.com/dominikzogg/energycalculator/blob/master/src/Dominikzogg/EnergyCalculator/Form/ComestibleType.php

@fabpot fabpot added the Form label Feb 5, 2015
@dominikzogg
Copy link
Author

@fabpot any news on this? if its to weird, i would suggest a compromise, which only caches if $queryBuilder is a QueryBuilder instance.

@Tobion
Copy link
Member

Tobion commented Mar 6, 2015

AFAIK, the caching of query builder has been previously removed because it could return a different query each time. So if this new caching implementation compensates this, it needs to be tested.

@dominikzogg
Copy link
Author

#13864

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

Successfully merging this pull request may close these issues.

3 participants