{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/13570","labels_url":"https://api.github.com/repos/symfony/symfony/issues/13570/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/13570/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/13570/events","html_url":"https://github.com/symfony/symfony/pull/13570","id":56178365,"number":13570,"title":"allow cache even if a closure get used for query_builder","user":{"login":"dominikzogg","id":1011217,"avatar_url":"https://avatars.githubusercontent.com/u/1011217?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikzogg","html_url":"https://github.com/dominikzogg","followers_url":"https://api.github.com/users/dominikzogg/followers","following_url":"https://api.github.com/users/dominikzogg/following{/other_user}","gists_url":"https://api.github.com/users/dominikzogg/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikzogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikzogg/subscriptions","organizations_url":"https://api.github.com/users/dominikzogg/orgs","repos_url":"https://api.github.com/users/dominikzogg/repos","events_url":"https://api.github.com/users/dominikzogg/events{/privacy}","received_events_url":"https://api.github.com/users/dominikzogg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-01T21:09:18Z","updated_at":"2015-03-05T21:56:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/13570","html_url":"https://github.com/symfony/symfony/pull/13570","diff_url":"https://github.com/symfony/symfony/pull/13570.diff","patch_url":"https://github.com/symfony/symfony/pull/13570.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets |\r\n| License       | MIT\r\n| Doc PR        |\r\n\r\nUsing entity types within a collection, can get very slow, if a query_builder option is set.\r\n\r\nWithout 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.\r\n\r\nhttps://github.com/dominikzogg/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L68\r\n\r\nhttps://github.com/dominikzogg/symfony/blob/2.7/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php#L108\r\n\r\nhttps://github.com/dominikzogg/energycalculator/blob/master/src/Dominikzogg/EnergyCalculator/Form/ComestibleType.php\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/77460769","html_url":"https://github.com/symfony/symfony/pull/13570#issuecomment-77460769","issue_url":"https://api.github.com/repos/symfony/symfony/issues/13570","id":77460769,"user":{"login":"dominikzogg","id":1011217,"avatar_url":"https://avatars.githubusercontent.com/u/1011217?v=3","gravatar_id":"","url":"https://api.github.com/users/dominikzogg","html_url":"https://github.com/dominikzogg","followers_url":"https://api.github.com/users/dominikzogg/followers","following_url":"https://api.github.com/users/dominikzogg/following{/other_user}","gists_url":"https://api.github.com/users/dominikzogg/gists{/gist_id}","starred_url":"https://api.github.com/users/dominikzogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominikzogg/subscriptions","organizations_url":"https://api.github.com/users/dominikzogg/orgs","repos_url":"https://api.github.com/users/dominikzogg/repos","events_url":"https://api.github.com/users/dominikzogg/events{/privacy}","received_events_url":"https://api.github.com/users/dominikzogg/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T21:56:41Z","updated_at":"2015-03-05T21:56:41Z","body":"@fabpot any news on this? if its to weird, i would suggest a compromise, which only caches if $queryBuilder is a QueryBuilder instance."}}