{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/51966693","id":51966693,"diff_hunk":"@@ -1063,6 +1065,18 @@ How fast is std::vector<Handle>, really?\n   emplace_back      7.26         3.35        1.96         1.87\n   reserve           7.66         6.01        4.75         4.13\n \n+count: the number of handles that are pushed/emplaced back.\n+\n+push_back: call the push-back method\n+     example: HandleSeq oset; oset.push_back(ha); oset.push_back(hb);\n+\n+emplace-back: call the emplace_back method\n+\n+reserve: create vector of fixed size, then assign directly.\n+     example: HandleSeq oset(2); oset[0] = ha; oset[1] = hb;\n+\n+Looks like direct assignment is a winner!","path":"opencog/benchmark/diary.txt","position":41,"original_position":41,"commit_id":"5ee950e5c25b3d2d524c7f840a532f6351741229","original_commit_id":"5ee950e5c25b3d2d524c7f840a532f6351741229","user":{"login":"inflector","id":1048706,"avatar_url":"https://avatars.githubusercontent.com/u/1048706?v=3","gravatar_id":"","url":"https://api.github.com/users/inflector","html_url":"https://github.com/inflector","followers_url":"https://api.github.com/users/inflector/followers","following_url":"https://api.github.com/users/inflector/following{/other_user}","gists_url":"https://api.github.com/users/inflector/gists{/gist_id}","starred_url":"https://api.github.com/users/inflector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inflector/subscriptions","organizations_url":"https://api.github.com/users/inflector/orgs","repos_url":"https://api.github.com/users/inflector/repos","events_url":"https://api.github.com/users/inflector/events{/privacy}","received_events_url":"https://api.github.com/users/inflector/received_events","type":"User","site_admin":false},"body":"Did you try reserve of fixed size then emplace_back? I think that might save a copy.","created_at":"2016-02-05T01:38:14Z","updated_at":"2016-02-05T01:38:14Z","html_url":"https://github.com/opencog/atomspace/pull/618#discussion_r51966693","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/618","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/51966693"},"html":{"href":"https://github.com/opencog/atomspace/pull/618#discussion_r51966693"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/618"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/618","id":58371009,"html_url":"https://github.com/opencog/atomspace/pull/618","diff_url":"https://github.com/opencog/atomspace/pull/618.diff","patch_url":"https://github.com/opencog/atomspace/pull/618.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/618","number":618,"state":"closed","locked":false,"title":"Avoid smart-pointer casts, where possible","user":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"body":"Per discussion in issue #513.\r\n\r\nMeasured the performance of the cast; its large and dominates the cost of getOutgoingSet().","created_at":"2016-02-05T00:17:52Z","updated_at":"2016-02-05T01:38:14Z","closed_at":"2016-02-05T00:29:49Z","merged_at":"2016-02-05T00:29:49Z","merge_commit_sha":"fa7939b01f5e3e091f09e6aa716140f068b9c91a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/618/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/618/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/618/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/5ee950e5c25b3d2d524c7f840a532f6351741229","head":{"label":"linas:cast","ref":"cast","sha":"5ee950e5c25b3d2d524c7f840a532f6351741229","user":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"repo":{"id":34914155,"name":"atomspace","full_name":"linas/atomspace","owner":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/linas/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/linas/atomspace","forks_url":"https://api.github.com/repos/linas/atomspace/forks","keys_url":"https://api.github.com/repos/linas/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linas/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linas/atomspace/teams","hooks_url":"https://api.github.com/repos/linas/atomspace/hooks","issue_events_url":"https://api.github.com/repos/linas/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/linas/atomspace/events","assignees_url":"https://api.github.com/repos/linas/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/linas/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/linas/atomspace/tags","blobs_url":"https://api.github.com/repos/linas/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linas/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linas/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/linas/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linas/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/linas/atomspace/languages","stargazers_url":"https://api.github.com/repos/linas/atomspace/stargazers","contributors_url":"https://api.github.com/repos/linas/atomspace/contributors","subscribers_url":"https://api.github.com/repos/linas/atomspace/subscribers","subscription_url":"https://api.github.com/repos/linas/atomspace/subscription","commits_url":"https://api.github.com/repos/linas/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/linas/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/linas/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/linas/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/linas/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/linas/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linas/atomspace/merges","archive_url":"https://api.github.com/repos/linas/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linas/atomspace/downloads","issues_url":"https://api.github.com/repos/linas/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/linas/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/linas/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/linas/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linas/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/linas/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/linas/atomspace/deployments","created_at":"2015-05-01T17:20:30Z","updated_at":"2016-01-11T03:18:13Z","pushed_at":"2016-02-05T01:21:20Z","git_url":"git://github.com/linas/atomspace.git","ssh_url":"git@github.com:linas/atomspace.git","clone_url":"https://github.com/linas/atomspace.git","svn_url":"https://github.com/linas/atomspace","homepage":"","size":142413,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"opencog:master","ref":"master","sha":"a6844d5b144b730916afc7a95f83d52312dd78c1","user":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"name":"atomspace","full_name":"opencog/atomspace","owner":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","deployments_url":"https://api.github.com/repos/opencog/atomspace/deployments","created_at":"2015-04-27T16:32:57Z","updated_at":"2016-01-11T03:17:22Z","pushed_at":"2016-02-05T01:26:10Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":149598,"stargazers_count":38,"watchers_count":38,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":28,"forks":47,"open_issues":28,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/618"},"html":{"href":"https://github.com/opencog/atomspace/pull/618"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/618"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/618/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/618/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/618/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/5ee950e5c25b3d2d524c7f840a532f6351741229"}}}}