{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/60725416","id":60725416,"diff_hunk":"@@ -80,98 +80,75 @@ func (r *Replica) executeCmd(ctx context.Context, raftCmdID storagebase.CmdIDKey\n \t// op already executed for overlapping keys.\n \tr.store.Clock().Update(ts)\n \n-\tvar reply roachpb.Response\n \tvar intents []roachpb.Intent\n \tvar err error\n \tswitch tArgs := args.(type) {","path":"storage/replica_command.go","position":35,"original_position":35,"commit_id":"761673a2b06ec8203033d3b1213cdc90a5d8459b","original_commit_id":"761673a2b06ec8203033d3b1213cdc90a5d8459b","user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"body":"Unrelated to this change, but could you add something like\r\n\r\n> // Note that responses are populated even when an error is returned.\r\n> // TODO(tschottdorf): Change that. IIRC there is nontrivial use of now.","created_at":"2016-04-22T11:29:24Z","updated_at":"2016-04-22T11:29:24Z","html_url":"https://github.com/cockroachdb/cockroach/pull/6222#discussion_r60725416","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/60725416"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/6222#discussion_r60725416"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222","id":67443218,"html_url":"https://github.com/cockroachdb/cockroach/pull/6222","diff_url":"https://github.com/cockroachdb/cockroach/pull/6222.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/6222.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6222","number":6222,"state":"open","locked":false,"title":"storage: reduce allocations when populating BatchResponse","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"body":"Instead of creating the response structs individually, we now loop over\r\nthe request and batch allocate all of the responses for a particular\r\ntype.\r\n\r\nI'm not sure why there is so much variation in the allocations for the\r\nInsert10000 benchmark.\r\n\r\n```\r\nname                  old time/op    new time/op    delta\r\nKVInsert1_SQL-32         498µs ± 3%     504µs ± 2%  +1.24%  (p=0.001 n=20+20)\r\nKVInsert10_SQL-32        971µs ± 2%     965µs ± 2%    ~     (p=0.175 n=19+20)\r\nKVInsert100_SQL-32      5.34ms ± 4%    5.34ms ± 5%    ~     (p=0.840 n=19+19)\r\nKVInsert1000_SQL-32     53.9ms ± 8%    53.9ms ±10%    ~     (p=0.779 n=20+20)\r\nKVInsert10000_SQL-32     726ms ± 7%     705ms ±10%    ~     (p=0.091 n=17+20)\r\n\r\nname                  old allocs/op  new allocs/op  delta\r\nKVInsert1_SQL-32           316 ± 0%       314 ± 0%  -0.76%  (p=0.000 n=20+17)\r\nKVInsert10_SQL-32          863 ± 0%       838 ± 0%  -2.81%  (p=0.000 n=20+20)\r\nKVInsert100_SQL-32       6.15k ± 0%     5.94k ± 0%  -3.35%  (p=0.000 n=20+20)\r\nKVInsert1000_SQL-32      59.5k ± 1%     57.5k ± 1%  -3.29%  (p=0.000 n=18+20)\r\nKVInsert10000_SQL-32      690k ± 7%      684k ± 9%    ~     (p=0.305 n=19+20)\r\n```\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/6222)\n<!-- Reviewable:end -->\n","created_at":"2016-04-22T00:33:10Z","updated_at":"2016-04-22T11:29:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"543cefa2336437f4bfadd253c10787ecfa7334d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6222/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/761673a2b06ec8203033d3b1213cdc90a5d8459b","head":{"label":"petermattis:pmattis/batch-response","ref":"pmattis/batch-response","sha":"761673a2b06ec8203033d3b1213cdc90a5d8459b","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"repo":{"id":49213713,"name":"cockroach","full_name":"petermattis/cockroach","owner":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petermattis/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":true,"url":"https://api.github.com/repos/petermattis/cockroach","forks_url":"https://api.github.com/repos/petermattis/cockroach/forks","keys_url":"https://api.github.com/repos/petermattis/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petermattis/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petermattis/cockroach/teams","hooks_url":"https://api.github.com/repos/petermattis/cockroach/hooks","issue_events_url":"https://api.github.com/repos/petermattis/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/petermattis/cockroach/events","assignees_url":"https://api.github.com/repos/petermattis/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/petermattis/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/petermattis/cockroach/tags","blobs_url":"https://api.github.com/repos/petermattis/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petermattis/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petermattis/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/petermattis/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petermattis/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/petermattis/cockroach/languages","stargazers_url":"https://api.github.com/repos/petermattis/cockroach/stargazers","contributors_url":"https://api.github.com/repos/petermattis/cockroach/contributors","subscribers_url":"https://api.github.com/repos/petermattis/cockroach/subscribers","subscription_url":"https://api.github.com/repos/petermattis/cockroach/subscription","commits_url":"https://api.github.com/repos/petermattis/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/petermattis/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/petermattis/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/petermattis/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/petermattis/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/petermattis/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petermattis/cockroach/merges","archive_url":"https://api.github.com/repos/petermattis/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petermattis/cockroach/downloads","issues_url":"https://api.github.com/repos/petermattis/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/petermattis/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/petermattis/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/petermattis/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petermattis/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/petermattis/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/petermattis/cockroach/deployments","created_at":"2016-01-07T15:46:02Z","updated_at":"2016-01-15T20:14:05Z","pushed_at":"2016-04-22T00:34:02Z","git_url":"git://github.com/petermattis/cockroach.git","ssh_url":"git@github.com:petermattis/cockroach.git","clone_url":"https://github.com/petermattis/cockroach.git","svn_url":"https://github.com/petermattis/cockroach","homepage":"http://www.cockroachlabs.com","size":150819,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"7330af43411417dc60927b5a4cee0ee715b2cadc","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/cockroachdb/cockroach/deployments","created_at":"2014-02-06T00:18:47Z","updated_at":"2016-04-22T08:16:58Z","pushed_at":"2016-04-22T09:48:25Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":"https://www.cockroachlabs.com","size":196761,"stargazers_count":6733,"watchers_count":6733,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":641,"mirror_url":null,"open_issues_count":427,"forks":641,"open_issues":427,"watchers":6733,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/6222"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/6222"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/6222/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6222/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/761673a2b06ec8203033d3b1213cdc90a5d8459b"}}}}