{"action":"opened","number":22419,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/22419","id":68392877,"html_url":"https://github.com/docker/docker/pull/22419","diff_url":"https://github.com/docker/docker/pull/22419.diff","patch_url":"https://github.com/docker/docker/pull/22419.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/22419","number":22419,"state":"open","locked":false,"title":"Remove reflection on CLI init","user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"body":"<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\n**- What I did**\r\nSpeed up CLI creation by ~95%\r\n**- How I did it**\r\nUse map lookup for commands instead of reflection\r\n\r\n**- How to verify it**\r\nbefore:\r\n```\r\n$ time docker --help\r\nreal  0m0.177s\r\nuser  0m0.000s\r\nsys 0m0.040s\r\n```\r\n\r\nafter:\r\n```\r\n$ time docker --help\r\nreal  0m0.010s\r\nuser  0m0.000s\r\nsys 0m0.000s\r\n```\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\n\r\nmeh\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n![](http://i.imgur.com/nYuYI.jpg)\r\n","created_at":"2016-04-29T15:51:00Z","updated_at":"2016-04-29T15:51:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/22419/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/22419/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/22419/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/6ae59c54e6d59480cda1561c7e1d0b0ec3b9fcab","head":{"label":"cpuguy83:reflection_is_for_mirrors","ref":"reflection_is_for_mirrors","sha":"6ae59c54e6d59480cda1561c7e1d0b0ec3b9fcab","user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"repo":{"id":15300899,"name":"docker","full_name":"cpuguy83/docker","owner":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cpuguy83/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/cpuguy83/docker","forks_url":"https://api.github.com/repos/cpuguy83/docker/forks","keys_url":"https://api.github.com/repos/cpuguy83/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cpuguy83/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cpuguy83/docker/teams","hooks_url":"https://api.github.com/repos/cpuguy83/docker/hooks","issue_events_url":"https://api.github.com/repos/cpuguy83/docker/issues/events{/number}","events_url":"https://api.github.com/repos/cpuguy83/docker/events","assignees_url":"https://api.github.com/repos/cpuguy83/docker/assignees{/user}","branches_url":"https://api.github.com/repos/cpuguy83/docker/branches{/branch}","tags_url":"https://api.github.com/repos/cpuguy83/docker/tags","blobs_url":"https://api.github.com/repos/cpuguy83/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cpuguy83/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cpuguy83/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/cpuguy83/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cpuguy83/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/cpuguy83/docker/languages","stargazers_url":"https://api.github.com/repos/cpuguy83/docker/stargazers","contributors_url":"https://api.github.com/repos/cpuguy83/docker/contributors","subscribers_url":"https://api.github.com/repos/cpuguy83/docker/subscribers","subscription_url":"https://api.github.com/repos/cpuguy83/docker/subscription","commits_url":"https://api.github.com/repos/cpuguy83/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/cpuguy83/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/cpuguy83/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/cpuguy83/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/cpuguy83/docker/contents/{+path}","compare_url":"https://api.github.com/repos/cpuguy83/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cpuguy83/docker/merges","archive_url":"https://api.github.com/repos/cpuguy83/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cpuguy83/docker/downloads","issues_url":"https://api.github.com/repos/cpuguy83/docker/issues{/number}","pulls_url":"https://api.github.com/repos/cpuguy83/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/cpuguy83/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/cpuguy83/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cpuguy83/docker/labels{/name}","releases_url":"https://api.github.com/repos/cpuguy83/docker/releases{/id}","deployments_url":"https://api.github.com/repos/cpuguy83/docker/deployments","created_at":"2013-12-19T02:58:40Z","updated_at":"2015-04-27T13:11:12Z","pushed_at":"2016-04-29T15:46:10Z","git_url":"git://github.com/cpuguy83/docker.git","ssh_url":"git@github.com:cpuguy83/docker.git","clone_url":"https://github.com/cpuguy83/docker.git","svn_url":"https://github.com/cpuguy83/docker","homepage":"http://www.docker.io","size":88792,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"24a8de2b60c68c72924d61cb0c4587944e3be5b4","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-04-29T15:42:34Z","pushed_at":"2016-04-29T15:45:44Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":190199,"stargazers_count":30866,"watchers_count":30866,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8767,"mirror_url":null,"open_issues_count":1527,"forks":8767,"open_issues":1527,"watchers":30866,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/22419"},"html":{"href":"https://github.com/docker/docker/pull/22419"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/22419"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/22419/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/22419/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/22419/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/6ae59c54e6d59480cda1561c7e1d0b0ec3b9fcab"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":78,"deletions":16,"changed_files":3}}