{"action":"closed","issue":{"url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/312","labels_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/312/comments","events_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/312/events","html_url":"https://github.com/PHP-DI/PHP-DI/issues/312","id":105055263,"number":312,"title":"Performances: Move some checks from resolvers to definition sources","user":{"login":"mnapoli","id":720328,"avatar_url":"https://avatars.githubusercontent.com/u/720328?v=3","gravatar_id":"","url":"https://api.github.com/users/mnapoli","html_url":"https://github.com/mnapoli","followers_url":"https://api.github.com/users/mnapoli/followers","following_url":"https://api.github.com/users/mnapoli/following{/other_user}","gists_url":"https://api.github.com/users/mnapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnapoli/subscriptions","organizations_url":"https://api.github.com/users/mnapoli/orgs","repos_url":"https://api.github.com/users/mnapoli/repos","events_url":"https://api.github.com/users/mnapoli/events{/privacy}","received_events_url":"https://api.github.com/users/mnapoli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PHP-DI/PHP-DI/labels/enhancement","name":"enhancement","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-05T23:13:59Z","updated_at":"2015-09-06T09:23:40Z","closed_at":"2015-09-06T09:23:40Z","body":"Since the work done by definition sources is cached, some checks (like check a class exists, is instantiable, etc.) can be moved to definition sources (and the result stored in definitions). That way it will only be executed once instead of for each request.\r\n\r\nThere might not be a lot of checks like that so might not be really worth it. But profiling the simplest use case shows that \"check class exists\" takes 7% of total time, and \"check class is instantiable\" takes 4%. In those cases, it might make a little difference."}}