{"action":"opened","number":31,"pull_request":{"url":"https://api.github.com/repos/kbacha/git-release-name/pulls/31","id":190768260,"html_url":"https://github.com/kbacha/git-release-name/pull/31","diff_url":"https://github.com/kbacha/git-release-name/pull/31.diff","patch_url":"https://github.com/kbacha/git-release-name/pull/31.patch","issue_url":"https://api.github.com/repos/kbacha/git-release-name/issues/31","number":31,"state":"open","locked":false,"title":"Improve performance of lookup","user":{"login":"kbacha","id":2043529,"avatar_url":"https://avatars0.githubusercontent.com/u/2043529?v=4","gravatar_id":"","url":"https://api.github.com/users/kbacha","html_url":"https://github.com/kbacha","followers_url":"https://api.github.com/users/kbacha/followers","following_url":"https://api.github.com/users/kbacha/following{/other_user}","gists_url":"https://api.github.com/users/kbacha/gists{/gist_id}","starred_url":"https://api.github.com/users/kbacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbacha/subscriptions","organizations_url":"https://api.github.com/users/kbacha/orgs","repos_url":"https://api.github.com/users/kbacha/repos","events_url":"https://api.github.com/users/kbacha/events{/privacy}","received_events_url":"https://api.github.com/users/kbacha/received_events","type":"User","site_admin":false},"body":"Two major performance changes:\r\n\r\n1. Parse the sha directly to u32 and use bit calculations to determine\r\nthe indexes of each.\r\n1. Stopped padding the incoming string which avoids a heap allocation.\r\n\r\nThe results were large:\r\n```\r\nBefore\r\nover 10 million iterations\r\n\r\nreal    0m5.605s\r\nuser    0m5.592s\r\nsys     0m0.006s\r\n\r\n`Sha` newtype\r\nover 10 million iterations\r\n\r\nreal    0m4.165s\r\nuser    0m4.153s\r\nsys     0m0.006s\r\n\r\nRemove format call to pad\r\nover 10 million iterations\r\n\r\nreal    0m1.944s\r\nuser    0m1.934s\r\nsys     0m0.006s\r\n```\r\n\r\nNow a single thread can handle almost 5 million parses a second. Behind\r\nactix-web, I hit roughly 40k requests per second. That's likely mostly a\r\nbottle neck of the web framework itself.\r\n\r\nIt also changes the error handling slightly.","created_at":"2018-05-27T03:06:20Z","updated_at":"2018-05-27T03:06:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kbacha/git-release-name/pulls/31/commits","review_comments_url":"https://api.github.com/repos/kbacha/git-release-name/pulls/31/comments","review_comment_url":"https://api.github.com/repos/kbacha/git-release-name/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kbacha/git-release-name/issues/31/comments","statuses_url":"https://api.github.com/repos/kbacha/git-release-name/statuses/07193e222b9c1f91615f374608705a36487fa703","head":{"label":"kbacha:performance-work","ref":"performance-work","sha":"07193e222b9c1f91615f374608705a36487fa703","user":{"login":"kbacha","id":2043529,"avatar_url":"https://avatars0.githubusercontent.com/u/2043529?v=4","gravatar_id":"","url":"https://api.github.com/users/kbacha","html_url":"https://github.com/kbacha","followers_url":"https://api.github.com/users/kbacha/followers","following_url":"https://api.github.com/users/kbacha/following{/other_user}","gists_url":"https://api.github.com/users/kbacha/gists{/gist_id}","starred_url":"https://api.github.com/users/kbacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbacha/subscriptions","organizations_url":"https://api.github.com/users/kbacha/orgs","repos_url":"https://api.github.com/users/kbacha/repos","events_url":"https://api.github.com/users/kbacha/events{/privacy}","received_events_url":"https://api.github.com/users/kbacha/received_events","type":"User","site_admin":false},"repo":{"id":116738230,"name":"git-release-name","full_name":"kbacha/git-release-name","owner":{"login":"kbacha","id":2043529,"avatar_url":"https://avatars0.githubusercontent.com/u/2043529?v=4","gravatar_id":"","url":"https://api.github.com/users/kbacha","html_url":"https://github.com/kbacha","followers_url":"https://api.github.com/users/kbacha/followers","following_url":"https://api.github.com/users/kbacha/following{/other_user}","gists_url":"https://api.github.com/users/kbacha/gists{/gist_id}","starred_url":"https://api.github.com/users/kbacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbacha/subscriptions","organizations_url":"https://api.github.com/users/kbacha/orgs","repos_url":"https://api.github.com/users/kbacha/repos","events_url":"https://api.github.com/users/kbacha/events{/privacy}","received_events_url":"https://api.github.com/users/kbacha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbacha/git-release-name","description":"Generate a release names based on a git sha","fork":false,"url":"https://api.github.com/repos/kbacha/git-release-name","forks_url":"https://api.github.com/repos/kbacha/git-release-name/forks","keys_url":"https://api.github.com/repos/kbacha/git-release-name/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbacha/git-release-name/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbacha/git-release-name/teams","hooks_url":"https://api.github.com/repos/kbacha/git-release-name/hooks","issue_events_url":"https://api.github.com/repos/kbacha/git-release-name/issues/events{/number}","events_url":"https://api.github.com/repos/kbacha/git-release-name/events","assignees_url":"https://api.github.com/repos/kbacha/git-release-name/assignees{/user}","branches_url":"https://api.github.com/repos/kbacha/git-release-name/branches{/branch}","tags_url":"https://api.github.com/repos/kbacha/git-release-name/tags","blobs_url":"https://api.github.com/repos/kbacha/git-release-name/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbacha/git-release-name/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbacha/git-release-name/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbacha/git-release-name/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbacha/git-release-name/statuses/{sha}","languages_url":"https://api.github.com/repos/kbacha/git-release-name/languages","stargazers_url":"https://api.github.com/repos/kbacha/git-release-name/stargazers","contributors_url":"https://api.github.com/repos/kbacha/git-release-name/contributors","subscribers_url":"https://api.github.com/repos/kbacha/git-release-name/subscribers","subscription_url":"https://api.github.com/repos/kbacha/git-release-name/subscription","commits_url":"https://api.github.com/repos/kbacha/git-release-name/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbacha/git-release-name/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbacha/git-release-name/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbacha/git-release-name/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbacha/git-release-name/contents/{+path}","compare_url":"https://api.github.com/repos/kbacha/git-release-name/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbacha/git-release-name/merges","archive_url":"https://api.github.com/repos/kbacha/git-release-name/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbacha/git-release-name/downloads","issues_url":"https://api.github.com/repos/kbacha/git-release-name/issues{/number}","pulls_url":"https://api.github.com/repos/kbacha/git-release-name/pulls{/number}","milestones_url":"https://api.github.com/repos/kbacha/git-release-name/milestones{/number}","notifications_url":"https://api.github.com/repos/kbacha/git-release-name/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbacha/git-release-name/labels{/name}","releases_url":"https://api.github.com/repos/kbacha/git-release-name/releases{/id}","deployments_url":"https://api.github.com/repos/kbacha/git-release-name/deployments","created_at":"2018-01-08T22:59:10Z","updated_at":"2018-05-25T22:16:45Z","pushed_at":"2018-05-27T03:05:14Z","git_url":"git://github.com/kbacha/git-release-name.git","ssh_url":"git@github.com:kbacha/git-release-name.git","clone_url":"https://github.com/kbacha/git-release-name.git","svn_url":"https://github.com/kbacha/git-release-name","homepage":"","size":185,"stargazers_count":18,"watchers_count":18,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":18,"default_branch":"master"}},"base":{"label":"kbacha:master","ref":"master","sha":"73cec74ae14993450aa73b0a8fbdad4ab5701374","user":{"login":"kbacha","id":2043529,"avatar_url":"https://avatars0.githubusercontent.com/u/2043529?v=4","gravatar_id":"","url":"https://api.github.com/users/kbacha","html_url":"https://github.com/kbacha","followers_url":"https://api.github.com/users/kbacha/followers","following_url":"https://api.github.com/users/kbacha/following{/other_user}","gists_url":"https://api.github.com/users/kbacha/gists{/gist_id}","starred_url":"https://api.github.com/users/kbacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbacha/subscriptions","organizations_url":"https://api.github.com/users/kbacha/orgs","repos_url":"https://api.github.com/users/kbacha/repos","events_url":"https://api.github.com/users/kbacha/events{/privacy}","received_events_url":"https://api.github.com/users/kbacha/received_events","type":"User","site_admin":false},"repo":{"id":116738230,"name":"git-release-name","full_name":"kbacha/git-release-name","owner":{"login":"kbacha","id":2043529,"avatar_url":"https://avatars0.githubusercontent.com/u/2043529?v=4","gravatar_id":"","url":"https://api.github.com/users/kbacha","html_url":"https://github.com/kbacha","followers_url":"https://api.github.com/users/kbacha/followers","following_url":"https://api.github.com/users/kbacha/following{/other_user}","gists_url":"https://api.github.com/users/kbacha/gists{/gist_id}","starred_url":"https://api.github.com/users/kbacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbacha/subscriptions","organizations_url":"https://api.github.com/users/kbacha/orgs","repos_url":"https://api.github.com/users/kbacha/repos","events_url":"https://api.github.com/users/kbacha/events{/privacy}","received_events_url":"https://api.github.com/users/kbacha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbacha/git-release-name","description":"Generate a release names based on a git sha","fork":false,"url":"https://api.github.com/repos/kbacha/git-release-name","forks_url":"https://api.github.com/repos/kbacha/git-release-name/forks","keys_url":"https://api.github.com/repos/kbacha/git-release-name/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbacha/git-release-name/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbacha/git-release-name/teams","hooks_url":"https://api.github.com/repos/kbacha/git-release-name/hooks","issue_events_url":"https://api.github.com/repos/kbacha/git-release-name/issues/events{/number}","events_url":"https://api.github.com/repos/kbacha/git-release-name/events","assignees_url":"https://api.github.com/repos/kbacha/git-release-name/assignees{/user}","branches_url":"https://api.github.com/repos/kbacha/git-release-name/branches{/branch}","tags_url":"https://api.github.com/repos/kbacha/git-release-name/tags","blobs_url":"https://api.github.com/repos/kbacha/git-release-name/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbacha/git-release-name/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbacha/git-release-name/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbacha/git-release-name/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbacha/git-release-name/statuses/{sha}","languages_url":"https://api.github.com/repos/kbacha/git-release-name/languages","stargazers_url":"https://api.github.com/repos/kbacha/git-release-name/stargazers","contributors_url":"https://api.github.com/repos/kbacha/git-release-name/contributors","subscribers_url":"https://api.github.com/repos/kbacha/git-release-name/subscribers","subscription_url":"https://api.github.com/repos/kbacha/git-release-name/subscription","commits_url":"https://api.github.com/repos/kbacha/git-release-name/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbacha/git-release-name/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbacha/git-release-name/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbacha/git-release-name/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbacha/git-release-name/contents/{+path}","compare_url":"https://api.github.com/repos/kbacha/git-release-name/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbacha/git-release-name/merges","archive_url":"https://api.github.com/repos/kbacha/git-release-name/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbacha/git-release-name/downloads","issues_url":"https://api.github.com/repos/kbacha/git-release-name/issues{/number}","pulls_url":"https://api.github.com/repos/kbacha/git-release-name/pulls{/number}","milestones_url":"https://api.github.com/repos/kbacha/git-release-name/milestones{/number}","notifications_url":"https://api.github.com/repos/kbacha/git-release-name/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbacha/git-release-name/labels{/name}","releases_url":"https://api.github.com/repos/kbacha/git-release-name/releases{/id}","deployments_url":"https://api.github.com/repos/kbacha/git-release-name/deployments","created_at":"2018-01-08T22:59:10Z","updated_at":"2018-05-25T22:16:45Z","pushed_at":"2018-05-27T03:05:14Z","git_url":"git://github.com/kbacha/git-release-name.git","ssh_url":"git@github.com:kbacha/git-release-name.git","clone_url":"https://github.com/kbacha/git-release-name.git","svn_url":"https://github.com/kbacha/git-release-name","homepage":"","size":185,"stargazers_count":18,"watchers_count":18,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kbacha/git-release-name/pulls/31"},"html":{"href":"https://github.com/kbacha/git-release-name/pull/31"},"issue":{"href":"https://api.github.com/repos/kbacha/git-release-name/issues/31"},"comments":{"href":"https://api.github.com/repos/kbacha/git-release-name/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/kbacha/git-release-name/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/kbacha/git-release-name/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kbacha/git-release-name/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/kbacha/git-release-name/statuses/07193e222b9c1f91615f374608705a36487fa703"}},"author_association":"OWNER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":147,"deletions":121,"changed_files":9}}
{"actor":{"display_login":"kbacha"}}