{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/223779959","pull_request_review_id":162990139,"id":223779959,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzc3OTk1OQ==","diff_hunk":"@@ -109,7 +109,11 @@ struct grpc_mdelem {\n                               (uintptr_t)GRPC_MDELEM_STORAGE_INTERNED_BIT))\n \n /* Unrefs the slices. */\n-grpc_mdelem grpc_mdelem_from_slices(grpc_slice key, grpc_slice value);\n+grpc_mdelem grpc_mdelem_from_slices(const grpc_slice& key,\n+                                    const grpc_slice& value);\n+/* Does not unref the slices. */\n+grpc_mdelem grpc_mdelem_from_slices_no_unref(const grpc_slice& key,","path":"src/core/lib/transport/metadata.h","position":8,"original_position":8,"commit_id":"d6b140df030f4032a2e039b0af174374141300b0","original_commit_id":"d6b140df030f4032a2e039b0af174374141300b0","user":{"login":"markdroth","id":18664614,"node_id":"MDQ6VXNlcjE4NjY0NjE0","avatar_url":"https://avatars2.githubusercontent.com/u/18664614?v=4","gravatar_id":"","url":"https://api.github.com/users/markdroth","html_url":"https://github.com/markdroth","followers_url":"https://api.github.com/users/markdroth/followers","following_url":"https://api.github.com/users/markdroth/following{/other_user}","gists_url":"https://api.github.com/users/markdroth/gists{/gist_id}","starred_url":"https://api.github.com/users/markdroth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdroth/subscriptions","organizations_url":"https://api.github.com/users/markdroth/orgs","repos_url":"https://api.github.com/users/markdroth/repos","events_url":"https://api.github.com/users/markdroth/events{/privacy}","received_events_url":"https://api.github.com/users/markdroth/received_events","type":"User","site_admin":false},"body":"Instead of having two versions of this method, could we perhaps convert the `grpc_slice` API to C++ and change these methods to take the slices as `RefCountedPtr<>`s?  That way, the semantic will be clear from the API.","created_at":"2018-10-09T16:47:55Z","updated_at":"2018-10-09T16:48:45Z","html_url":"https://github.com/grpc/grpc/pull/16801#discussion_r223779959","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/16801","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/223779959"},"html":{"href":"https://github.com/grpc/grpc/pull/16801#discussion_r223779959"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16801"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/16801","id":220986897,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwOTg2ODk3","html_url":"https://github.com/grpc/grpc/pull/16801","diff_url":"https://github.com/grpc/grpc/pull/16801.diff","patch_url":"https://github.com/grpc/grpc/pull/16801.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/16801","number":16801,"state":"open","locked":false,"title":"Avoid unnecessary ref/unref calls to get mdelem from slices.","user":{"login":"soheilhy","id":394885,"node_id":"MDQ6VXNlcjM5NDg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/394885?v=4","gravatar_id":"","url":"https://api.github.com/users/soheilhy","html_url":"https://github.com/soheilhy","followers_url":"https://api.github.com/users/soheilhy/followers","following_url":"https://api.github.com/users/soheilhy/following{/other_user}","gists_url":"https://api.github.com/users/soheilhy/gists{/gist_id}","starred_url":"https://api.github.com/users/soheilhy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soheilhy/subscriptions","organizations_url":"https://api.github.com/users/soheilhy/orgs","repos_url":"https://api.github.com/users/soheilhy/repos","events_url":"https://api.github.com/users/soheilhy/events{/privacy}","received_events_url":"https://api.github.com/users/soheilhy/received_events","type":"User","site_admin":false},"body":"grpc_mdelem_from_slices() unref's the key and value. As a result,\r\nin quite a few cases on the hot path, we first ref slice, so that\r\ngrpc_mdelem_from_slices() can unref them.\r\n\r\nAdd grpc_mdelem_from_slices_no_unref() which does not unref() the\r\ninput slices. This cuts 0.5% - 1.0% across app benchmarks.","created_at":"2018-10-08T01:17:27Z","updated_at":"2018-10-09T16:48:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e9f179b8030bcd6e12afcad79e58d64d3d35e56","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dgquintas","id":120217,"node_id":"MDQ6VXNlcjEyMDIxNw==","avatar_url":"https://avatars3.githubusercontent.com/u/120217?v=4","gravatar_id":"","url":"https://api.github.com/users/dgquintas","html_url":"https://github.com/dgquintas","followers_url":"https://api.github.com/users/dgquintas/followers","following_url":"https://api.github.com/users/dgquintas/following{/other_user}","gists_url":"https://api.github.com/users/dgquintas/gists{/gist_id}","starred_url":"https://api.github.com/users/dgquintas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgquintas/subscriptions","organizations_url":"https://api.github.com/users/dgquintas/orgs","repos_url":"https://api.github.com/users/dgquintas/repos","events_url":"https://api.github.com/users/dgquintas/events{/privacy}","received_events_url":"https://api.github.com/users/dgquintas/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":961832073,"node_id":"MDU6TGFiZWw5NjE4MzIwNzM=","url":"https://api.github.com/repos/grpc/grpc/labels/release%20notes:%20no","name":"release notes: no","color":"0f5f75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/16801/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/16801/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/16801/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/d6b140df030f4032a2e039b0af174374141300b0","head":{"label":"soheilhy:worktree-slice","ref":"worktree-slice","sha":"d6b140df030f4032a2e039b0af174374141300b0","user":{"login":"soheilhy","id":394885,"node_id":"MDQ6VXNlcjM5NDg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/394885?v=4","gravatar_id":"","url":"https://api.github.com/users/soheilhy","html_url":"https://github.com/soheilhy","followers_url":"https://api.github.com/users/soheilhy/followers","following_url":"https://api.github.com/users/soheilhy/following{/other_user}","gists_url":"https://api.github.com/users/soheilhy/gists{/gist_id}","starred_url":"https://api.github.com/users/soheilhy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soheilhy/subscriptions","organizations_url":"https://api.github.com/users/soheilhy/orgs","repos_url":"https://api.github.com/users/soheilhy/repos","events_url":"https://api.github.com/users/soheilhy/events{/privacy}","received_events_url":"https://api.github.com/users/soheilhy/received_events","type":"User","site_admin":false},"repo":{"id":150319181,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAzMTkxODE=","name":"grpc","full_name":"soheilhy/grpc","private":false,"owner":{"login":"soheilhy","id":394885,"node_id":"MDQ6VXNlcjM5NDg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/394885?v=4","gravatar_id":"","url":"https://api.github.com/users/soheilhy","html_url":"https://github.com/soheilhy","followers_url":"https://api.github.com/users/soheilhy/followers","following_url":"https://api.github.com/users/soheilhy/following{/other_user}","gists_url":"https://api.github.com/users/soheilhy/gists{/gist_id}","starred_url":"https://api.github.com/users/soheilhy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soheilhy/subscriptions","organizations_url":"https://api.github.com/users/soheilhy/orgs","repos_url":"https://api.github.com/users/soheilhy/repos","events_url":"https://api.github.com/users/soheilhy/events{/privacy}","received_events_url":"https://api.github.com/users/soheilhy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/soheilhy/grpc","description":"The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/soheilhy/grpc","forks_url":"https://api.github.com/repos/soheilhy/grpc/forks","keys_url":"https://api.github.com/repos/soheilhy/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soheilhy/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soheilhy/grpc/teams","hooks_url":"https://api.github.com/repos/soheilhy/grpc/hooks","issue_events_url":"https://api.github.com/repos/soheilhy/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/soheilhy/grpc/events","assignees_url":"https://api.github.com/repos/soheilhy/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/soheilhy/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/soheilhy/grpc/tags","blobs_url":"https://api.github.com/repos/soheilhy/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soheilhy/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soheilhy/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/soheilhy/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soheilhy/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/soheilhy/grpc/languages","stargazers_url":"https://api.github.com/repos/soheilhy/grpc/stargazers","contributors_url":"https://api.github.com/repos/soheilhy/grpc/contributors","subscribers_url":"https://api.github.com/repos/soheilhy/grpc/subscribers","subscription_url":"https://api.github.com/repos/soheilhy/grpc/subscription","commits_url":"https://api.github.com/repos/soheilhy/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/soheilhy/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/soheilhy/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/soheilhy/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/soheilhy/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/soheilhy/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soheilhy/grpc/merges","archive_url":"https://api.github.com/repos/soheilhy/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soheilhy/grpc/downloads","issues_url":"https://api.github.com/repos/soheilhy/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/soheilhy/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/soheilhy/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/soheilhy/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soheilhy/grpc/labels{/name}","releases_url":"https://api.github.com/repos/soheilhy/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/soheilhy/grpc/deployments","created_at":"2018-09-25T19:32:45Z","updated_at":"2018-09-25T19:33:02Z","pushed_at":"2018-10-08T20:20:49Z","git_url":"git://github.com/soheilhy/grpc.git","ssh_url":"git@github.com:soheilhy/grpc.git","clone_url":"https://github.com/soheilhy/grpc.git","svn_url":"https://github.com/soheilhy/grpc","homepage":"https://grpc.io","size":184838,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"3b26fe7262a9db90dfb69f84ad582d9f71871a5c","user":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"node_id":"MDEwOlJlcG9zaXRvcnkyNzcyOTg4MA==","name":"grpc","full_name":"grpc/grpc","private":false,"owner":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc/deployments","created_at":"2014-12-08T18:58:53Z","updated_at":"2018-10-09T16:05:43Z","pushed_at":"2018-10-09T15:46:38Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"https://grpc.io","size":194484,"stargazers_count":17420,"watchers_count":17420,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":3981,"mirror_url":null,"archived":false,"open_issues_count":1047,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3981,"open_issues":1047,"watchers":17420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16801"},"html":{"href":"https://github.com/grpc/grpc/pull/16801"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/16801"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/16801/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16801/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16801/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/d6b140df030f4032a2e039b0af174374141300b0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"markdroth"}}