{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/196364104","pull_request_review_id":129899928,"id":196364104,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjM2NDEwNA==","diff_hunk":"@@ -47,11 +49,22 @@ static std::string generate_object_prefix(int pid = 0) {\n   return oss.str();\n }\n \n-static std::string generate_object_name(int objnum, int pid = 0)\n+// this is 8x faster than previous impl based on chained, deduped functions call\n+static std::string generate_object_name_fast(int objnum, int pid = 0)\n {\n-  std::ostringstream oss;\n-  oss << generate_object_prefix(pid) << \"_object\" << objnum;\n-  return oss.str();\n+  if (cached_hostname[0] == 0) {\n+\tgethostname(cached_hostname, sizeof(cached_hostname)-1);\n+\tcached_hostname[sizeof(cached_hostname)-1] = 0;\n+  }\n+\n+  if (pid)\n+\tcached_pid = pid;\n+  else if (!cached_pid)\n+\tcached_pid = getpid();\n+\n+  char name[1024];\n+  size_t n = snprintf(&name[0], sizeof(name),  BENCH_OBJ_NAME.c_str(), cached_hostname, cached_pid, objnum);\n+  return std::string(&name[0], n);","path":"src/common/obj_bencher.cc","position":null,"original_position":32,"commit_id":"ef3de76c71ac3c21b585eced7b0616d2853bf27d","original_commit_id":"2805bd74351a73b3e9626212ebaf0f925312dc99","user":{"login":"ErwanAliasr1","id":4539421,"node_id":"MDQ6VXNlcjQ1Mzk0MjE=","avatar_url":"https://avatars3.githubusercontent.com/u/4539421?v=4","gravatar_id":"","url":"https://api.github.com/users/ErwanAliasr1","html_url":"https://github.com/ErwanAliasr1","followers_url":"https://api.github.com/users/ErwanAliasr1/followers","following_url":"https://api.github.com/users/ErwanAliasr1/following{/other_user}","gists_url":"https://api.github.com/users/ErwanAliasr1/gists{/gist_id}","starred_url":"https://api.github.com/users/ErwanAliasr1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErwanAliasr1/subscriptions","organizations_url":"https://api.github.com/users/ErwanAliasr1/orgs","repos_url":"https://api.github.com/users/ErwanAliasr1/repos","events_url":"https://api.github.com/users/ErwanAliasr1/events{/privacy}","received_events_url":"https://api.github.com/users/ErwanAliasr1/received_events","type":"User","site_admin":false},"body":"Thx ","created_at":"2018-06-19T10:02:43Z","updated_at":"2018-06-19T10:02:43Z","html_url":"https://github.com/ceph/ceph/pull/22576#discussion_r196364104","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/22576","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/196364104"},"html":{"href":"https://github.com/ceph/ceph/pull/22576#discussion_r196364104"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/22576"}},"in_reply_to_id":196082674},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/22576","id":195180200,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTgwMjAw","html_url":"https://github.com/ceph/ceph/pull/22576","diff_url":"https://github.com/ceph/ceph/pull/22576.diff","patch_url":"https://github.com/ceph/ceph/pull/22576.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/22576","number":22576,"state":"open","locked":false,"title":"common/obj_bencher.cc: faster object name generation","user":{"login":"branch-predictor","id":12440680,"node_id":"MDQ6VXNlcjEyNDQwNjgw","avatar_url":"https://avatars3.githubusercontent.com/u/12440680?v=4","gravatar_id":"","url":"https://api.github.com/users/branch-predictor","html_url":"https://github.com/branch-predictor","followers_url":"https://api.github.com/users/branch-predictor/followers","following_url":"https://api.github.com/users/branch-predictor/following{/other_user}","gists_url":"https://api.github.com/users/branch-predictor/gists{/gist_id}","starred_url":"https://api.github.com/users/branch-predictor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branch-predictor/subscriptions","organizations_url":"https://api.github.com/users/branch-predictor/orgs","repos_url":"https://api.github.com/users/branch-predictor/repos","events_url":"https://api.github.com/users/branch-predictor/events{/privacy}","received_events_url":"https://api.github.com/users/branch-predictor/received_events","type":"User","site_admin":false},"body":"This is revival of my commit 42d81bffc4d57bceb98872dadc8e57400981588c\r\nthat was partially reverted in 0aa29f37658211c6189b44c6c67a7bda9294c7c7.\r\nAdded extra comment and removed original generate_object_name func\r\nto prevent confusion in the future.\r\n\r\nSigned-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>","created_at":"2018-06-15T13:47:50Z","updated_at":"2018-06-19T10:02:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3330f45e0ae50aeb7288677c616e94ba0cfbb3d7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/22576/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/22576/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/22576/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/ef3de76c71ac3c21b585eced7b0616d2853bf27d","head":{"label":"ovh:bp-gen-obj-name-fast","ref":"bp-gen-obj-name-fast","sha":"ef3de76c71ac3c21b585eced7b0616d2853bf27d","user":{"login":"ovh","id":1698434,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTg0MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1698434?v=4","gravatar_id":"","url":"https://api.github.com/users/ovh","html_url":"https://github.com/ovh","followers_url":"https://api.github.com/users/ovh/followers","following_url":"https://api.github.com/users/ovh/following{/other_user}","gists_url":"https://api.github.com/users/ovh/gists{/gist_id}","starred_url":"https://api.github.com/users/ovh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovh/subscriptions","organizations_url":"https://api.github.com/users/ovh/orgs","repos_url":"https://api.github.com/users/ovh/repos","events_url":"https://api.github.com/users/ovh/events{/privacy}","received_events_url":"https://api.github.com/users/ovh/received_events","type":"Organization","site_admin":false},"repo":{"id":71800123,"node_id":"MDEwOlJlcG9zaXRvcnk3MTgwMDEyMw==","name":"ceph","full_name":"ovh/ceph","owner":{"login":"ovh","id":1698434,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTg0MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1698434?v=4","gravatar_id":"","url":"https://api.github.com/users/ovh","html_url":"https://github.com/ovh","followers_url":"https://api.github.com/users/ovh/followers","following_url":"https://api.github.com/users/ovh/following{/other_user}","gists_url":"https://api.github.com/users/ovh/gists{/gist_id}","starred_url":"https://api.github.com/users/ovh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovh/subscriptions","organizations_url":"https://api.github.com/users/ovh/orgs","repos_url":"https://api.github.com/users/ovh/repos","events_url":"https://api.github.com/users/ovh/events{/privacy}","received_events_url":"https://api.github.com/users/ovh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ovh/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/ovh/ceph","forks_url":"https://api.github.com/repos/ovh/ceph/forks","keys_url":"https://api.github.com/repos/ovh/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ovh/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ovh/ceph/teams","hooks_url":"https://api.github.com/repos/ovh/ceph/hooks","issue_events_url":"https://api.github.com/repos/ovh/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ovh/ceph/events","assignees_url":"https://api.github.com/repos/ovh/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ovh/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ovh/ceph/tags","blobs_url":"https://api.github.com/repos/ovh/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ovh/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ovh/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ovh/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ovh/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ovh/ceph/languages","stargazers_url":"https://api.github.com/repos/ovh/ceph/stargazers","contributors_url":"https://api.github.com/repos/ovh/ceph/contributors","subscribers_url":"https://api.github.com/repos/ovh/ceph/subscribers","subscription_url":"https://api.github.com/repos/ovh/ceph/subscription","commits_url":"https://api.github.com/repos/ovh/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ovh/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ovh/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ovh/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ovh/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ovh/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ovh/ceph/merges","archive_url":"https://api.github.com/repos/ovh/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ovh/ceph/downloads","issues_url":"https://api.github.com/repos/ovh/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ovh/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ovh/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ovh/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ovh/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ovh/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ovh/ceph/deployments","created_at":"2016-10-24T14:57:02Z","updated_at":"2018-06-18T22:22:16Z","pushed_at":"2018-06-19T06:53:59Z","git_url":"git://github.com/ovh/ceph.git","ssh_url":"git@github.com:ovh/ceph.git","clone_url":"https://github.com/ovh/ceph.git","svn_url":"https://github.com/ovh/ceph","homepage":"http://ceph.com","size":288650,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"33c773a810a20c4853313301bfd483c64f78a07a","user":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"node_id":"MDEwOlJlcG9zaXRvcnkyMzEwNDk1","name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2018-06-19T09:52:18Z","pushed_at":"2018-06-19T10:02:21Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":290157,"stargazers_count":4627,"watchers_count":4627,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2484,"mirror_url":null,"archived":false,"open_issues_count":690,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2484,"open_issues":690,"watchers":4627,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/22576"},"html":{"href":"https://github.com/ceph/ceph/pull/22576"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/22576"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/22576/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/22576/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/22576/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/ef3de76c71ac3c21b585eced7b0616d2853bf27d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ErwanAliasr1"}}